views:

125

answers:

1

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()));
+6  A: 

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