Aracılığıyla paylaş


PostWebTestEventArgs Sınıf

İçin veri sağlar WebTest.PostWebTest olay.

Devralma Hiyerarşisi

Object
  EventArgs
    Microsoft.VisualStudio.TestTools.WebTesting.PostWebTestEventArgs

Ad alanı:  Microsoft.VisualStudio.TestTools.WebTesting
Derleme:  Microsoft.VisualStudio.QualityTools.WebTestFramework (Microsoft.VisualStudio.QualityTools.WebTestFramework.dll içinde)

Sözdizimi

'Bildirim
Public Class PostWebTestEventArgs _
    Inherits EventArgs
public class PostWebTestEventArgs : EventArgs
public ref class PostWebTestEventArgs : public EventArgs
type PostWebTestEventArgs =  
    class 
        inherit EventArgs 
    end
public class PostWebTestEventArgs extends EventArgs

PostWebTestEventArgs türü aşağıdaki üyeleri ortaya koyar.

Özellikler

  Ad Açıklama
Genel özellik WebTest Alır WebTest tamamlandı ve neden nesne PostWebTest olay.

Üst

Yöntemler

  Ad Açıklama
Genel yöntem Equals Determines whether the specified object is equal to the current object. (Object kaynağından devralındı.)
Korumalı yöntem Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Object kaynağından devralındı.)
Genel yöntem GetHashCode Serves as the default hash function. (Object kaynağından devralındı.)
Genel yöntem GetType Gets the Type of the current instance. (Object kaynağından devralındı.)
Korumalı yöntem MemberwiseClone Creates a shallow copy of the current Object. (Object kaynağından devralındı.)
Genel yöntem ToString Returns a string that represents the current object. (Object kaynağından devralındı.)

Üst

Notlar

Bu, özellikle bir başvuru sağlar WebTest çağrılan PostWebTest olay.

Örnekler

Web performans testi çalıştırılır ve son uzunluğunu görüntüler önce bağlamına rasgele bir sayı ekler bir Web performans sınaması eklentisi aşağıdaki örnekte gösterildiği WebTestResponse Web performans testi çalıştıktan sonra.

Kullanımına dikkat edin PostWebTestEventArgs başvuru sağlayarak, WebTest.

using System;
using Microsoft.VisualStudio.TestTools.WebTesting;
using System.Windows.Forms;

namespace WebTestPluginNamespace
{
    public class MyWebTestPlugin : WebTestPlugin
    {
        public static string NewRandomNumberString(int size)
        {
            byte[] buffer = new byte[size];
            // Seed using system time
            Random random = new Random(unchecked((int)DateTime.Now.Ticks));

            random.NextBytes(buffer);
            return BitConverter.ToInt32(buffer, 0).ToString();
        }

        public override void PreWebTest(object sender, PreWebTestEventArgs e)
        {
            e.WebTest.Context["RandNum"] = NewRandomNumberString(4);
        }
        public override void PostWebTest(object sender, PostWebTestEventArgs e)
        {
            MessageBox.Show(e.WebTest.LastResponse.ContentLength.ToString());
        }
    }
}

İş Parçacığı Güvenliği

Bu türün tüm genel statik (Visual Basic'te Shared) üyeleri iş parçacığı açısından güvenlidir. Hiçbir örnek üyesinin iş parçacığı açısından güvenliği garanti edilemez.

Ayrıca bkz.

Başvuru

Microsoft.VisualStudio.TestTools.WebTesting Ad Alanı

Diğer Kaynaklar

Working with Web Tests