Sdílet prostřednictvím


STATestMethodAttribute Třída

Definice

Atribut testovací třídy.

[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
Dědičnost
STATestMethodAttribute
Atributy

Konstruktory

Name Description
STATestMethodAttribute()

Inicializuje novou instanci STATestMethodAttribute třídy.

STATestMethodAttribute(String, Int32)

Inicializuje novou instanci STATestMethodAttribute třídy.

STATestMethodAttribute(String)

Inicializuje novou instanci STATestMethodAttribute třídy.

STATestMethodAttribute(TestMethodAttribute)

Inicializuje novou instanci STATestMethodAttribute třídy. Tento konstruktor má být volána STATestClassAttribute (nebo odvozena) k zabalení existujícího atributu testovací metody. Lze jej také volat odvozeným STATestMethodAttribute , který bude volána odvozenou STATestClassAttribute.

Vlastnosti

Name Description
DeclaringFilePath

Získá cestu k souboru, který deklaruje atribut.

(Zděděno od TestMethodAttribute)
DeclaringLineNumber

Získá číslo řádku v rámci DeclaringFilePath deklaruje atribut.

(Zděděno od TestMethodAttribute)
DisplayName

Získá nebo nastaví zobrazovaný název testu.

(Zděděno od TestMethodAttribute)
UnfoldingStrategy

Získá nebo nastaví strategii pro rozbalení parametrizovaných testů.

(Zděděno od TestMethodAttribute)
UseSTASynchronizationContext

Získá nebo nastaví hodnotu určující, zda atribut nastaví SynchronizationContext , který zachová stejné sta vlákno pro asynchronní pokračování. Výchozí hodnota je false.

Metody

Name Description
Execute(ITestMethod)

Spustí testovací metodu.

(Zděděno od TestMethodAttribute)
ExecuteAsync(ITestMethod)

Spustí testovací metodu.

ExecuteCoreAsync(ITestMethod)

Základní provedení testovací metody STA, ke kterému dochází ve vlákně STA.

Platí pro