Wait with timeout (5 seconds) for all expected methods to be called
Namespace: TypeMock
Assembly: TypeMock (in TypeMock.dll) Version: 9.3.6.0 (9.3.6.0)
Syntax
Remarks
Examples
[Test] public void TestCallsInOtherThread () { // Let mock the product - it will not mock constructors; Mock productMock = MockManager.Mock(typeof(Product),Constructor.NotMocked); // CalculatePrice will return 10 - expect 10 as argument productMock.ExpectAndReturn("CalculatePrice",10F).Args(10); // our method will be called in a new thread Thread theThread = new Thread(new ThreadStart(RunWithWait)); theThread.Start(); // If we use Verify we dont know when the thread will actually be called // Here we WAIT for the mocked methods to be called, or the timeout. // Default timeout is 5000 milliseconds productMock.VerifyWithTimeout(); }
See Also