In these situations, I use the layout instead of the stub and combination Expectand VerifyAllExpectations:
var engineMock = MockRepository.GenerateMock<IEngine>();
var car = new Car(engineMock);
car.DriveToGroceryStore();
engineMock.Expect(e => e.OpenThrottle());
car.DriveHome();
engineMock.VerifyAllExpectations();
In this case, the wait is placed in the method after the layout is complete. Sometimes I think of it as my own testing style: Arrange, Expect, Act, Assert
source
share