Udostępnij za pośrednictwem


ConditionBaseAttribute Klasa

Definicja

Ten atrybut służy do warunkowego kontrolowania, czy klasa testowa, czy metoda testowa zostanie uruchomiona lub zostanie zignorowana, na podstawie warunku i przy użyciu opcjonalnego komunikatu.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, Inherited=false)]
public abstract class ConditionBaseAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, Inherited=false)]
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class ConditionBaseAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, Inherited=false)>]
type ConditionBaseAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, Inherited=false)>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type ConditionBaseAttribute = class
    inherit Attribute
Public MustInherit Class ConditionBaseAttribute
Inherits Attribute
Dziedziczenie
ConditionBaseAttribute
Pochodne
Atrybuty

Uwagi

Ten atrybut nie jest dziedziczony. Zastosowanie go do klasy bazowej nie będzie miało wpływu na klasy pochodne.

Konstruktory

Nazwa Opis
ConditionBaseAttribute(ConditionMode)

Inicjuje nowe wystąpienie klasy ConditionBaseAttribute.

Właściwości

Nazwa Opis
GroupName

Pobiera nazwę grupy dla tego atrybutu. Jest to istotne, gdy istnieje wiele atrybutów dziedzicujących ConditionBaseAttribute . IsConditionMet Wartości atrybutów w tej samej grupie są ze sobą "OR". Chociaż wartość z różnych grup jest "AND"ed razem. Innymi słowy, test zostanie zignorowany, jeśli każda grupa ma wszystkie jej IsConditionMet wartości jako false.

IgnoreMessage

Pobiera lub ustawia komunikat ignoruj wskazujący przyczynę ignorowania metody testowej lub klasy testowej.

IsConditionMet

Pobiera wartość wskazującą, czy warunek jest spełniony. Implementacja tej właściwości nie powinna odczytywać Mode właściwości.

Mode

Pobiera tryb warunku.

ShouldRun

Pobiera wartość wskazującą, czy metoda testowa czy klasa testowa powinna być ignorowana.

Dotyczy