I have a mocked interface that gets called twice from another object -
rather than having to assert that my mock method was called twice
(Repeat.Twice()), is there a way to reset the statistics on the mock
method, so that I can verify only the second call?

for example, the test may look like this:


[Test]
public void TestSomething()
{
  ISomething something = MockRepository.GenerateMock<ISomething>();
  SUT sut = new SUT(something);

  sut.DoSomething(); //this calls something.Something();
  sut.DoTheOther(); // this also calls something.Something();

  something.AssertWasCalled(s => s.Something(), mo => mo.Repeat.Twice
());
}

but what I really want to do is something like this:

[Test]
public void TestSomething()
{
  ISomething something = MockRepository.GenerateMock<ISomething>();
  SUT sut = new SUT(something);

  sut.DoSomething(); //this calls something.Something();

  something.ResetStats(s => s.Something());  //reset the execution
count and other stats for the specified method

  sut.DoTheOther(); //this also calls something.Something();

  something.AssertWasCalled(s => s.Something(), mo => mo.Repeat.Once
());
}


is this in RhinoMocks already? if not, any suggestions on how I can go
about creating this functionality? I'm willing to do the work and
submit a patch if it's not already there.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to