Evaluates a block of code that contains multiple related assertions.

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

Syntax

C#
public static void Multiple(
	Action action,
	string messageFormat,
	params Object[] messageArgs
)
Visual Basic (Declaration)
Public Shared Sub Multiple ( _
	action As Action, _
	messageFormat As String, _
	ParamArray messageArgs As Object() _
)

Parameters

action
Type: Gallio.Common..::.Action
The action to invoke.
messageFormat
Type: System..::.String
The custom assertion message format, or null if none.
messageArgs
Type: array< System..::.Object >[]()[]
The custom assertion message arguments, or null if none.

Remarks

While the action delegate runs, the behavior of assertions is change such that failures are captured but do not cause a AssertionFailureException to be throw. When the delegate returns, the previous assertion failure behavior is restored and any captured assertion failures are reported. The net effect of this change is that the test can continue to run even after an assertion failure occurs which can help to provide more information about the problem.

A multiple assertion block is useful for verifying the state of a single component with many parts that require several assertions to check. This feature can accelerate debugging because more diagnostic information become available at once.

Exceptions

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

See Also