ExpectedExceptionAttribute Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
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
Visual Studio SDK 2022 i druge verzije
Proizvod | Verzije |
---|---|
Visual Studio SDK | 2017, 2019, 2022 |
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
Visual Studio SDK 2022 i druge verzije
Proizvod | Verzije |
---|---|
Visual Studio SDK | 2017, 2019, 2022 |
Povratne informacije o proizvodu .NET
.NET je projekt otvorenog koda. Odaberite vezu za slanje povratnih informacija: