Given an interface as follows:
interface ISomething
{
void Method(int arg1, string arg2, double arg3, OtherType arg4);
}
Used in mocking with RhinoMocks
ISomething something = MockRepository.GenerateMock<ISomething>();
The only way I know to check this is never called in my test is as follows:
something.Expect(_ => _.Method(
Arg<int>.Is.Anything,
Arg<string>.Is.Anything,
Arg<double>.Is.Anything,
Arg<OtherType>.Is.Anything)
).Repeat.Never();
This is pretty ugly. Is there a shorter way to do this for the special case a method is not called at all?