Verifies that an assertion succeeded.

Namespace:  Gallio.Framework.Assertions
Assembly:  Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public static void Verify(
	Func<AssertionFailure> assertionFunc
)
Visual Basic (Declaration)
Public Shared Sub Verify ( _
	assertionFunc As Func(Of AssertionFailure) _
)

Parameters

assertionFunc
Type: Gallio.Common..::.Func<(Of <(AssertionFailure>)>)
The assertion function to evaluate.

Remarks

The assertion function should return null to indicate that the assertion has passed or AssertionFailure to indicate that it has failed.

If the assertion function throws an exception it is reported as an assertion failure unless the exception is a TestException (except AssertionFailureException) in which case the exception is rethrown by this method. This behavior enables special test exceptions such as TestTerminatedException to be used to terminate the test at any point instead of being reported as assertion failures.

When an assertion failure is detected, it is submitted to SubmitFailure(AssertionFailure) which may choose to throw a AssertionFailureException or do something else.

Using this method enables the system to track statistics about assertions and to ensure that assertion failures are reported uniformly.

It is important to note that not all failures will result in a AssertionFailureException being thrown. Refer to SubmitFailure(AssertionFailure) for details.

Exceptions

ExceptionCondition
System..::.ArgumentNullExceptionThrown if assertionFunc is null.

See Also