Udostępnij za pośrednictwem


STATestMethodAttribute Klasa

Definicja

Atrybut klasy testowej.

[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
Dziedziczenie
STATestMethodAttribute
Atrybuty

Konstruktory

Nazwa Opis
STATestMethodAttribute()

Inicjuje nowe wystąpienie klasy STATestMethodAttribute.

STATestMethodAttribute(String, Int32)

Inicjuje nowe wystąpienie klasy STATestMethodAttribute.

STATestMethodAttribute(String)

Inicjuje nowe wystąpienie klasy STATestMethodAttribute.

STATestMethodAttribute(TestMethodAttribute)

Inicjuje nowe wystąpienie klasy STATestMethodAttribute. Ten konstruktor ma być wywoływany przez STATestClassAttribute (lub pochodne) w celu opakowania istniejącego atrybutu metody testowej. Może być również wywoływany przez pochodną STATestMethodAttribute , która będzie wywoływana przez pochodną STATestClassAttribute.

Właściwości

Nazwa Opis
DeclaringFilePath

Pobiera ścieżkę pliku, która deklaruje atrybut.

(Odziedziczone po TestMethodAttribute)
DeclaringLineNumber

Pobiera numer wiersza, który DeclaringFilePath deklaruje atrybut .

(Odziedziczone po TestMethodAttribute)
DisplayName

Pobiera lub ustawia nazwę wyświetlaną testu.

(Odziedziczone po TestMethodAttribute)
UnfoldingStrategy

Pobiera lub ustawia strategię rozwoju sparametryzowanych testów.

(Odziedziczone po TestMethodAttribute)
UseSTASynchronizationContext

Pobiera lub ustawia wartość wskazującą, czy atrybut ustawi SynchronizationContext atrybut, który zachowuje ten sam wątek STA dla kontynuacji asynchronicznych. Wartość domyślna to false.

Metody

Nazwa Opis
Execute(ITestMethod)

Wykonuje metodę testową.

(Odziedziczone po TestMethodAttribute)
ExecuteAsync(ITestMethod)

Wykonuje metodę testową.

ExecuteCoreAsync(ITestMethod)

Podstawowe wykonanie metody testowej STA, która odbywa się w wątku STA.

Dotyczy