| SmartTestRunTest Method (Criteria, ExpressionActionActContext, Assertion) |
Executes the Act part of the test and its related Smart Assertions.
Namespace:
SmartTests
Assembly:
SmartTests (in SmartTests.dll) Version: 1.12.0
Syntax public static void RunTest(
Criteria cases,
Expression<Action<ActContext>> act,
params Assertion[] assertions
)
Public Shared Sub RunTest (
cases As Criteria,
act As Expression(Of Action(Of ActContext)),
ParamArray assertions As Assertion()
)
public:
static void RunTest(
Criteria^ cases,
Expression<Action<ActContext^>^>^ act,
... array<Assertion^>^ assertions
)
static member RunTest :
cases : Criteria *
act : Expression<Action<ActContext>> *
assertions : Assertion[] -> unit
Parameters
- cases
- Type: SmartTestsCriteria
The Criteria expression for the tested code. - act
- Type: System.Linq.ExpressionsExpressionActionActContext
An Action representing the tested code with an ActContext. - assertions
- Type: SmartTestsAssertion
The Smart Assertions for this act.
Exceptions Remarks Examples [Test]
public void MyMethodTest()
{
var mc = new MyClass( 300 );
RunTest( AnyValue.IsValid,
ctx => mc.Method( ctx.SetHandle ),
SmartAssert.Within( 100 ),
SmartAssert.WaitContextHandle( 1000 ) );
Assert.IsTrue( result );
Assert.IsTrue( mc.Done );
Assert.IsNull( mc.Exception );
}
See Also