ExpectedExceptionBaseAttribute.Verify Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntax

'Declaration
Protected Friend MustOverride Sub Verify ( _
    exception As Exception _
)
protected internal abstract void Verify(
    Exception exception
)
protected public:
virtual void Verify(
    Exception^ exception
) abstract
abstract Verify : 
        exception:Exception -> unit
abstract function Verify(
    exception : Exception
)

Parameters

  • exception
    Type: Exception

    The exception that is thrown by the unit test.

Remarks

Determines whether the exception thrown is the expected exception. If the method returns, the exception was the expected exception. If the method throws an exception, the exception was not the expected exception. The message from the thrown exception is included in the test result. The Assert class can be used for convenience to throw an exception. If Assert.Inconclusive is used and the assertion statement is executed, the test outcome is set to Inconclusive.

.NET Framework Security

See Also

Reference

ExpectedExceptionBaseAttribute Class

Microsoft.VisualStudio.TestTools.UnitTesting Namespace