STATestMethodAttribute Sınıf

Tanım

Test sınıfı özniteliği.

[System.AttributeUsage(System.AttributeTargets.Method)]
public class STATestMethodAttribute : Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute
[System.AttributeUsage(System.AttributeTargets.Method)]
[System.Runtime.CompilerServices.Nullable(0)]
public class STATestMethodAttribute : Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute
[<System.AttributeUsage(System.AttributeTargets.Method)>]
type STATestMethodAttribute = class
    inherit TestMethodAttribute
[<System.AttributeUsage(System.AttributeTargets.Method)>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type STATestMethodAttribute = class
    inherit TestMethodAttribute
Public Class STATestMethodAttribute
Inherits TestMethodAttribute
Devralma
STATestMethodAttribute
Öznitelikler

Oluşturucular

Name Description
STATestMethodAttribute()

STATestMethodAttribute sınıfının yeni bir örneğini başlatır.

STATestMethodAttribute(String, Int32)

STATestMethodAttribute sınıfının yeni bir örneğini başlatır.

STATestMethodAttribute(String)

STATestMethodAttribute sınıfının yeni bir örneğini başlatır.

STATestMethodAttribute(TestMethodAttribute)

STATestMethodAttribute sınıfının yeni bir örneğini başlatır. Bu oluşturucu, mevcut bir test yöntemi özniteliğini sarmak için tarafından STATestClassAttribute çağrılmaya (veya türetilmiş) amaçlanmıştır. Türetilmiş STATestMethodAttribute tarafından da çağrılabilir ve türetilmiş STATestClassAttributetarafından çağrılabilir.

Özellikler

Name Description
DeclaringFilePath

Özniteliğini bildiren dosya yolunu alır.

(Devralındığı yer: TestMethodAttribute)
DeclaringLineNumber

özniteliğini bildiren satır numarasını DeclaringFilePath alır.

(Devralındığı yer: TestMethodAttribute)
DisplayName

Test için görünen adı alır veya ayarlar.

(Devralındığı yer: TestMethodAttribute)
UnfoldingStrategy

Parametreli testleri açma stratejisini alır veya ayarlar.

(Devralındığı yer: TestMethodAttribute)
UseSTASynchronizationContext

Özniteliğin zaman uyumsuz devamlılıklar için aynı STA iş parçacığını koruyan bir SynchronizationContext ayarlayıp ayarlamayacağını belirten bir değer alır veya ayarlar. Varsayılan değer: false.

Yöntemler

Name Description
Execute(ITestMethod)

Bir test yöntemi yürütür.

(Devralındığı yer: TestMethodAttribute)
ExecuteAsync(ITestMethod)

Bir test yöntemi yürütür.

ExecuteCoreAsync(ITestMethod)

STA iş parçacığında gerçekleşen STA test yönteminin çekirdek yürütmesi.

Şunlara uygulanır