| SmartTestRunTestT Method (Case, ExpressionFuncT, 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 T RunTest<T>(
Case cases,
Expression<Func<T>> act,
params Assertion[] assertions
)
Public Shared Function RunTest(Of T) (
cases As Case,
act As Expression(Of Func(Of T)),
ParamArray assertions As Assertion()
) As T
public:
generic<typename T>
static T RunTest(
Case^ cases,
Expression<Func<T>^>^ act,
... array<Assertion^>^ assertions
)
static member RunTest :
cases : Case *
act : Expression<Func<'T>> *
assertions : Assertion[] -> 'T
Parameters
- cases
- Type: SmartTestsCase
The Case expression for the tested expression. - act
- Type: System.Linq.ExpressionsExpressionFuncT
A lambda 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:
TThe value of the expression of the
act.
Exceptions Remarks Examples [Test]
public void Max_ValuesGreaterThanMin()
{
var remainder;
var result = RunTest( Case( "a", AnyValue.IsValid ) &
Case( "b", ValidValue.IsValid ),
() => Math.DivRem( 5, 2, out remainder ) );
Assert.AreEqual( 2, result );
Assert.AreEqual( 1, remainder );
}
See Also