Поделиться через


ConditionBaseAttribute Class

Definition

This attribute is used to conditionally control whether a test class or a test method will run or be ignored, based on a condition and using an optional message.

[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)>]
type ConditionBaseAttribute = class
    inherit Attribute
Public MustInherit Class ConditionBaseAttribute
Inherits Attribute
Inheritance
ConditionBaseAttribute
Derived
Attributes

Remarks

This attribute isn't inherited. Applying it to a base class will not affect derived classes.

Constructors

ConditionBaseAttribute(ConditionMode)

Initializes a new instance of the ConditionBaseAttribute class.

Properties

GroupName

Gets the group name for this attribute. This is relevant when multiple attributes that inherit ConditionBaseAttribute are present. The ShouldRun values of attributes in the same group are "OR"ed together. While the value from different groups is "AND"ed together. In other words, a test will be ignored if any group has all its ShouldRun values as false.

IgnoreMessage

Gets the ignore message (in case ShouldRun returns false) indicating the reason for ignoring the test method or test class.

ShouldRun

Gets a value indicating whether the test method or test class should be ignored.

Applies to