I'm writing NUnit tests with RhinoMocks. One of the tests looks like this:
mock = MockRepository<IFoo>.CreateMock();
// Arrange
// During the Arrange part, mock.MyMethod() gets called several times.
// Act
// During the Act part, mock.MyMethod() should be called exactly once.
// Assert
mock.AssertWasCalled(x => x.MyMethod()).Repeat.Once();
Naturally this fails because MyMethod() has been called more than once.
Is there a way I can reset the count of calls to MyMethod() before the Act part, so that only calls made after the reset are captured?