ExecutableConditionAttribute Constructors

Definition

Overloads

Name Description
ExecutableConditionAttribute(String)

Initializes a new instance of the ExecutableConditionAttribute class that includes the test only when the given executable is available on PATH.

ExecutableConditionAttribute(ConditionMode, String)

Initializes a new instance of the ExecutableConditionAttribute class that checks whether the given executable is available on PATH.

ExecutableConditionAttribute(String, String[])

Initializes a new instance of the ExecutableConditionAttribute class that includes the test only when the given command is available.

ExecutableConditionAttribute(ConditionMode, String, String[])

Initializes a new instance of the ExecutableConditionAttribute class.

ExecutableConditionAttribute(String)

Source:
ExecutableConditionAttribute.cs

Initializes a new instance of the ExecutableConditionAttribute class that includes the test only when the given executable is available on PATH.

public ExecutableConditionAttribute(string executable);
new Microsoft.VisualStudio.TestTools.UnitTesting.ExecutableConditionAttribute : string -> Microsoft.VisualStudio.TestTools.UnitTesting.ExecutableConditionAttribute
Public Sub New (executable As String)

Parameters

executable
String

The executable to look for. This is typically a bare command name (for example docker), but a path containing a directory separator is also supported, in which case it is checked directly instead of being resolved against PATH.

Applies to

ExecutableConditionAttribute(ConditionMode, String)

Source:
ExecutableConditionAttribute.cs

Initializes a new instance of the ExecutableConditionAttribute class that checks whether the given executable is available on PATH.

public ExecutableConditionAttribute(Microsoft.VisualStudio.TestTools.UnitTesting.ConditionMode mode, string executable);
new Microsoft.VisualStudio.TestTools.UnitTesting.ExecutableConditionAttribute : Microsoft.VisualStudio.TestTools.UnitTesting.ConditionMode * string -> Microsoft.VisualStudio.TestTools.UnitTesting.ExecutableConditionAttribute
Public Sub New (mode As ConditionMode, executable As String)

Parameters

mode
ConditionMode

Decides whether the test is included or excluded when the executable is available.

executable
String

The executable to look for. This is typically a bare command name (for example docker), but a path containing a directory separator is also supported, in which case it is checked directly instead of being resolved against PATH.

Applies to

ExecutableConditionAttribute(String, String[])

Source:
ExecutableConditionAttribute.cs

Initializes a new instance of the ExecutableConditionAttribute class that includes the test only when the given command is available.

public ExecutableConditionAttribute(string executable, params string[] arguments);
new Microsoft.VisualStudio.TestTools.UnitTesting.ExecutableConditionAttribute : string * string[] -> Microsoft.VisualStudio.TestTools.UnitTesting.ExecutableConditionAttribute
Public Sub New (executable As String, ParamArray arguments As String())

Parameters

executable
String

The executable to look for. This is typically a bare command name (for example docker), but a path containing a directory separator is also supported, in which case it is checked directly instead of being resolved against PATH.

arguments
String[]

Optional arguments. When omitted, only the presence of executable on PATH is checked. When provided, executable arguments is executed and the condition is met only if it exits with code 0.

Applies to

ExecutableConditionAttribute(ConditionMode, String, String[])

Source:
ExecutableConditionAttribute.cs

Initializes a new instance of the ExecutableConditionAttribute class.

public ExecutableConditionAttribute(Microsoft.VisualStudio.TestTools.UnitTesting.ConditionMode mode, string executable, params string[] arguments);
new Microsoft.VisualStudio.TestTools.UnitTesting.ExecutableConditionAttribute : Microsoft.VisualStudio.TestTools.UnitTesting.ConditionMode * string * string[] -> Microsoft.VisualStudio.TestTools.UnitTesting.ExecutableConditionAttribute
Public Sub New (mode As ConditionMode, executable As String, ParamArray arguments As String())

Parameters

mode
ConditionMode

Decides whether the test is included or excluded when the command is available.

executable
String

The executable to look for. This is typically a bare command name (for example docker), but a path containing a directory separator is also supported, in which case it is checked directly instead of being resolved against PATH.

arguments
String[]

Optional arguments. When omitted, only the presence of executable on PATH is checked. When provided, executable arguments is executed and the condition is met only if it exits with code 0.

Applies to