.net - Is there a neater way to stipulate a method should not be called in RhinoMocks? -
given interface follows:
interface isomething { void method(int arg1, string arg2, double arg3, othertype arg4); }
used in mocking rhinomocks
isomething = mockrepository.generatemock<isomething>();
the way know check never called in test follows:
something.expect(_ => _.method( arg<int>.is.anything, arg<string>.is.anything, arg<double>.is.anything, arg<othertype>.is.anything) ).repeat.never();
this pretty ugly. there shorter way special case method not called @ all?
using ignorearguments()
faster specifying each argument individually:
something.expect(_ => _.method(0, "", 0, null)).ignorearguments().repeat.never();
Comments
Post a Comment