Click or drag to resize

SmartTestRunTestT Method (Case, ActT, Assertion)

Executes the Act part of the test and its related Smart Assertions.

Namespace:  SmartTests
Assembly:  SmartTests (in SmartTests.dll) Version: 1.9.0
Syntax
public static T RunTest<T>(
	Case cases,
	Act<T> act,
	params Assertion[] assertions
)

Parameters

cases
Type: SmartTestsCase
The Case expression for the tested expression.
act
Type: SmartTestsActT
A ActT expression representing the tested expression.
assertions
Type: SmartTestsAssertion
The Smart Assertions for this act.

Type Parameters

T
The Type of the expression in the Act part of the test.

Return Value

Type: T
The value of the expression of the act.
Exceptions
ExceptionCondition
SmartTestExceptionIn case a Smart Assertion fails after the act.
BadTestExceptionIn case a Smart Assertion fails before the act.
Remarks
Examples
[Test]
public void MyPropertyTest()
{
    var mc = new MyClass( 10 );

    RunTest( Case( "index", MinIncluded.IsMin ) &
             Case( MinIncluded.IsAboveMin ),
             Assign( () => mc.Values[ 0 ], 2 ) );

    Assert.AreEqual( 2, mc.Values[ 0 ] );
}
See Also

Reference

SmartTestRunTestT(Case, ActT, Assertion)