Wait with timeout (im milliseconds) for all expected methods to be called
Namespace: TypeMock
Assembly: TypeMock (in TypeMock.dll) Version: 9.4.1.0 (9.4.1.0)
Syntax
Parameters
- millisecondsTimeout
- Type: SystemInt32
Time to wait for all expected methods to be called
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 1000 milliseconds for the mocked methods to be called, or the timeout. MockManager.VerifyWithTimeout(1000); }
See Also