Click or drag to resize

SmartTestRunTest Method (Case, Act, Assertion)

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

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

Parameters

cases
Type: SmartTestsCase
The Case expression for the tested code.
act
Type: SmartTestsAct
An Act instance representing the tested code.
assertions
Type: SmartTestsAssertion
The Smart Assertions for this act.
Exceptions
ExceptionCondition
SmartTestExceptionIn case a Smart Assertion fails after the act.
BadTestExceptionIn case a Smart Assertion fails before the act.
Remarks
If you need to specify Criteria expressions for multiple parameters, you have to use RunTest(Case, Act, Assertion) instead.
Examples
[Test]
public void ReturnVoidTest()
{
    var mc = new MyClass( 10 );

    RunTest( Case( "p1", MinIncluded.IsAboveMin ) &
             Case( "p2", MinIncluded.IsAboveMin ),
             () => mc.SetValues( 2, 3 ) );

    Assert.AreEqual( 2, mc.Value1 );
    Assert.AreEqual( 3, mc.Value2 );
}
See Also