Sparky Mark (sparkymark) wrote in csharp,
Sparky Mark
sparkymark
csharp

NMock2 question

Is it possible in NMock2 to expect one of two different methods, A() or B(), on a mock to be called?

If there was a way to check how many times a given method had already been called, I could just

Expect.Once.On.(myMock).Method("A");
Expect.Once.On.(myMock).Method("B");
test(myMock);

..and then test to see if one of them had been called and forcibly call the other so the expectations would be met. Ugly but good enough, but I don't think NMock2 mocks expose any interface that allows that the number of calls to be tested?
Subscribe
  • Post a new comment

    Error

    default userpic
  • 0 comments