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 : ConditionalTestAttributeBaseRemarks
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
ConditionalTestAttributeBaseRunIfAttribute
Constructors
| Name | Description |
|---|---|
| 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.csInitializes 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.csInitializes a new instance of the RunIfAttribute class.
public RunIfAttribute(TestGlobalizationMode globalizationMode)Parameters
globalizationModeTestGlobalizationMode- The globalization mode the test runs in.
RunIfAttribute(TestOperatingSystems)
RunIfAttribute.csInitializes a new instance of the RunIfAttribute class.
public RunIfAttribute(TestOperatingSystems operatingSystem)Parameters
operatingSystemTestOperatingSystems- The operating systems the test runs on.
RunIfAttribute(TestOperatingSystems, TestGlobalizationMode)
RunIfAttribute.csInitializes a new instance of the RunIfAttribute class.
public RunIfAttribute(TestOperatingSystems operatingSystem, TestGlobalizationMode globalizationMode)Parameters
operatingSystemTestOperatingSystems- The operating systems the test runs on.
globalizationModeTestGlobalizationMode- The globalization mode the test runs in.
RunIfAttribute(WindowsGroups)
RunIfAttribute.csInitializes a new instance of the RunIfAttribute class.
public RunIfAttribute(WindowsGroups windowsGroup)Parameters
windowsGroupWindowsGroups- The Windows group membership the test requires.