Language

ConditionBaseAttribute クラス

定義

この属性は、条件に基づいて、オプションのメッセージを使用して、テスト クラスまたはテスト メソッドを実行するか無視するかを条件付きで制御するために使用されます。

[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
継承
ConditionBaseAttribute
派生
属性

注釈

この属性は継承されません。 基底クラスに適用しても、派生クラスには影響しません。

同じ条件属性の型を 1 つのテスト クラスまたはテスト メソッドに複数回適用できるかどうかは、各派生属性によって独自の AllowMultiple 値によって決定されます。

条件属性は、属性の種類に関係なく、 GroupName 値によってグループ化されます。 同じグループ内の値は論理 OR と結合され、異なるグループは論理 AND と結合されます。 組み込みの条件属性の種類では、条件の種類ごとに異なるグループ名が使用されるため、それらの組み込みの種類を組み合わせるには、すべてが満たされている必要があります。

コンストラクター

名前 説明
ConditionBaseAttribute(ConditionMode)

ConditionBaseAttribute クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
GroupName

この属性のグループ名を取得します。 これは、 ConditionBaseAttribute を継承する複数の属性が存在する場合に関連します。 同じグループ内の属性の IsConditionMet 値は、"OR" で結合されます。 異なるグループの値は "AND" 一緒に使用されます。 つまり、すべての IsConditionMet 値が false の場合、テストは無視されます。

IgnoreMessage

テスト メソッドまたはテスト クラスを無視する理由を示す無視メッセージを取得または設定します。

IsConditionMet

条件が満たされているかどうかを示す値を取得します。 このプロパティの実装では、 Mode プロパティを読み取ってはいけません。

Mode

条件モードを取得します。

ShouldRun

テスト メソッドまたはテスト クラスを無視するかどうかを示す値を取得します。

適用対象