Language

DependsOnAttribute Constructors

Definition

Overloads

Name Description
DependsOnAttribute(String)

Initializes a new instance of the DependsOnAttribute class declaring a dependency on another test method of the same test class.

DependsOnAttribute(Type)

Initializes a new instance of the DependsOnAttribute class declaring a dependency on every test of another test class.

DependsOnAttribute(Type, String)

Initializes a new instance of the DependsOnAttribute class declaring a dependency on a specific test method of another test class.

DependsOnAttribute(String)

Initializes a new instance of the DependsOnAttribute class declaring a dependency on another test method of the same test class.

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

Parameters

testMethodName
String

The name of the prerequisite test method. Use nameof so that renaming the method is caught by the compiler.

Exceptions

testMethodName is null.

testMethodName is empty or whitespace.

Applies to

DependsOnAttribute(Type)

Initializes a new instance of the DependsOnAttribute class declaring a dependency on every test of another test class.

public DependsOnAttribute(Type testClass);
new Microsoft.VisualStudio.TestTools.UnitTesting.DependsOnAttribute : Type -> Microsoft.VisualStudio.TestTools.UnitTesting.DependsOnAttribute
Public Sub New (testClass As Type)

Parameters

testClass
Type

The prerequisite test class.

Exceptions

testClass is null.

Applies to

DependsOnAttribute(Type, String)

Initializes a new instance of the DependsOnAttribute class declaring a dependency on a specific test method of another test class.

public DependsOnAttribute(Type testClass, string testMethodName);
new Microsoft.VisualStudio.TestTools.UnitTesting.DependsOnAttribute : Type * string -> Microsoft.VisualStudio.TestTools.UnitTesting.DependsOnAttribute
Public Sub New (testClass As Type, testMethodName As String)

Parameters

testClass
Type

The test class declaring the prerequisite.

testMethodName
String

The name of the prerequisite test method. Use nameof so that renaming the method is caught by the compiler.

Exceptions

testClass or testMethodName is null.

testMethodName is empty or whitespace.

Applies to