3

Is it possible to tell that a mock/stub has seen no interaction at all in RhinoMocks. Something along the lines of:

logger.AssertNoInteraction();

Which would assert no method has been called on the stubbed logger.

This would be a much less tedious than calling the following each time:

logger.AssertWasNotCalled(l => l.Debug(Arg<string>.Is.Anything()));
logger.AssertWasNotCalled(l => l.Info(Arg<string>.Is.Anything()));
logger.AssertWasNotCalled(l => l.Warning(Arg<string>.Is.Anything()));
logger.AssertWasNotCalled(l => l.Error(Arg<string>.Is.Anything()));
Péter Török
  • 114,404
  • 31
  • 268
  • 329
grootjans
  • 592
  • 1
  • 6
  • 17

1 Answers1

6

If you use a strict mock and you do not set up an expectation you will get an exception if a call was made to the mock.

Burt
  • 7,680
  • 18
  • 71
  • 127