WaitAssertionsSetHandle Method |
Namespace: SmartTests.Assertions
Exception | Condition |
---|---|
BadTestException | If the Wait assertion is not waiting the implicit wait handle ( WaitContextHandle(SmartAssertPlaceHolder, TimeSpan) nor WaitContextHandle(SmartAssertPlaceHolder, Double) is called). |
In this example, the SetHandle set the implicit wait handle expected by the WaitContextHandle(SmartAssertPlaceHolder, Double) Smart Assertion call.
[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( mc.Done ); // The method runs the parallel code (ctx.SetHandle) to its end. Assert.IsNull( mc.Exception ); // There was no exception in the parallel code thread. }