RunIfAttribute Class

Runs the test only when every condition defined by the attribute matches; otherwise the test is skipped.

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class RunIfAttribute : ConditionalTestAttributeBase

Remarks

The attribute can be applied to a test method and to its test class. When both define a condition, the test runs only when both match.

Inheritance
ConditionalTestAttributeBase RunIfAttribute

Constructors

NameDescription
RunIfAttribute()Initializes a new instance of the RunIfAttribute class. At least one condition must be set using the properties of the attribute.
RunIfAttribute(TestGlobalizationMode)Initializes a new instance of the RunIfAttribute class.
RunIfAttribute(TestOperatingSystems)Initializes a new instance of the RunIfAttribute class.
RunIfAttribute(TestOperatingSystems, TestGlobalizationMode)Initializes a new instance of the RunIfAttribute class.
RunIfAttribute(WindowsGroups)Initializes a new instance of the RunIfAttribute class.

RunIfAttribute overloads

RunIfAttribute()

RunIfAttribute.cs

Initializes a new instance of the RunIfAttribute class. At least one condition must be set using the properties of the attribute.

public RunIfAttribute()

RunIfAttribute(TestGlobalizationMode)

RunIfAttribute.cs

Initializes a new instance of the RunIfAttribute class.

public RunIfAttribute(TestGlobalizationMode globalizationMode)
Parameters
globalizationMode TestGlobalizationMode
The globalization mode the test runs in.

RunIfAttribute(TestOperatingSystems)

RunIfAttribute.cs

Initializes a new instance of the RunIfAttribute class.

public RunIfAttribute(TestOperatingSystems operatingSystem)
Parameters
operatingSystem TestOperatingSystems
The operating systems the test runs on.

RunIfAttribute(TestOperatingSystems, TestGlobalizationMode)

RunIfAttribute.cs

Initializes a new instance of the RunIfAttribute class.

public RunIfAttribute(TestOperatingSystems operatingSystem, TestGlobalizationMode globalizationMode)
Parameters
operatingSystem TestOperatingSystems
The operating systems the test runs on.
globalizationMode TestGlobalizationMode
The globalization mode the test runs in.

RunIfAttribute(WindowsGroups)

RunIfAttribute.cs

Initializes a new instance of the RunIfAttribute class.

public RunIfAttribute(WindowsGroups windowsGroup)
Parameters
windowsGroup WindowsGroups
The Windows group membership the test requires.