Click or drag to resize

ThrowAssertionsThrowT Method (SmartAssertPlaceHolder, ActionT)

Creates an Assertion that ensure the provided exception type is thrown.

Namespace:  SmartTests.Assertions
Assembly:  SmartTests (in SmartTests.dll) Version: 1.12.0
Syntax
public static Assertion Throw<T>(
	this SmartAssertPlaceHolder _,
	Action<T> verify = null
)
where T : Exception

Parameters

_
Type: SmartTestsSmartAssertPlaceHolder
The dummy place holder for all Smart Assertions.
verify (Optional)
Type: SystemActionT
Code to add verifications on the exception.

Type Parameters

T
The expected exception type

Return Value

Type: Assertion
The newly created Assertion.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SmartAssertPlaceHolder. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
Should be the first assertion.
See Also