Compartir a través de


ExpectedExceptionAttribute Constructors

Definition

Overloads

ExpectedExceptionAttribute(Type)

Initializes a new instance of the ExpectedExceptionAttribute class with the expected type

ExpectedExceptionAttribute(Type, String)

Initializes a new instance of the ExpectedExceptionAttribute class with the expected type and the message to include when no exception is thrown by the test.

ExpectedExceptionAttribute(Type)

Initializes a new instance of the ExpectedExceptionAttribute class with the expected type

public:
 ExpectedExceptionAttribute(Type ^ exceptionType);
public ExpectedExceptionAttribute (Type exceptionType);
new Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute : Type -> Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute
Public Sub New (exceptionType As Type)

Parameters

exceptionType
Type

Type of the expected exception

Applies to

ExpectedExceptionAttribute(Type, String)

Initializes a new instance of the ExpectedExceptionAttribute class with the expected type and the message to include when no exception is thrown by the test.

public:
 ExpectedExceptionAttribute(Type ^ exceptionType, System::String ^ noExceptionMessage);
public ExpectedExceptionAttribute (Type exceptionType, string noExceptionMessage);
new Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute : Type * string -> Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute
Public Sub New (exceptionType As Type, noExceptionMessage As String)

Parameters

exceptionType
Type

Type of the expected exception

noExceptionMessage
String

Message to include in the test result if the test fails due to not throwing an exception

Applies to