Add reporting to to mocks, outputing as much information as possible for every method invoked
When your debugging or simply trying to understand what is happening it would be very useful if we could get a list of all the methods that were invoked on a particular mock (or all mocks from a factory)
This could either be in the form of an explicit call:
or as part of the ToString():
we have significantly improved this reporting in case of verify errors. Would you want this to also be available when the verifications actually succeed too?
I finally managed to take a look at version 4, and the reporting on verifications is awesome, great work.
However this is not the case I am suggesting here. What I'm suggesting is another method which has nothing to do with Verifications which just dumps out all the invocations on the mock, so we can see what actually happened.
This is useful when Mock is used at a higher level than simple unit tests such as integration tests, and dumping out all the interactions would be easier than attaching a debugger. I tried adding this feature myself and managed to get something to work but there was a few things I didn't understand about the internal workings of Moq which suggested my code wouldn't work in all cases. Even with this I was able to use it to track down a bug i wouldn't have easily found without it.