Let's say I have a test using RhinoMock. I'm using the AAA aproach, so it's usually ended with
fooMock.AssertWasCalled(x=>x.Foo(bar))
If the assertion failed, I'd usually add a line looking like this
fooMock.GetArgumentsForCallsMadeOn(x=>x.Foo(null)).PrintDump()
so I can see what calls was made on mock (it helps, because usually the problem is that mock is called with wrong arguments).
Is there any way I can automate the process? So, tell RhinoMock to print the calls was made on mock's method if an assertion failed?
It seems there is no built-in mechanism to dump arguments for failed assertions.
I'd suggest to use an extension method like the following:
Then in the code you can just write:
PS
I assume you already have an implementation of
PrintDump()extension.