In my experience, it is very important to have good error messages.
They are a key point whether you can use a mocking framework
efficiently or not.

In the example posted, I'd say that all error messages are okay. You
will find the reason for the error.
However, Moq does a very god job to point you at the piece of code
that is wrong, with a good explanation. NMock2 has the best "human
readable" message and it gives the mock objects names (error message
can even be improved if you name your mocks explicitely). Rhino Mocks,
has to most complex message, without a reference to a mock or code.

But anyway, all frameworks will add a stack trace that contains the
line on which the error occurred. Therefore the problem is always easy
to spot.

One last point, the real benefit of NMock2 is that you can name your
mocks. That is especially helpful if you have for example two almost
identical mocks in your test and you want to destinguish them and that
error messages say which mock is the trouble maker. In Moq you would
have to use different variables in the lamba expression which could
make your test code less readable (due to length of setup). However
this is not always possible if it is a piece of out "sourced" code
that has no knowledge of different mocks).

Happy mocking

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to