rhino-mocks icon indicating copy to clipboard operation
rhino-mocks copied to clipboard

Expectation failed error message

Open whatupdave opened this issue 15 years ago • 0 comments

The current expectation error message looks like this:

Rhino.Mocks.Exceptions.ExpectationViolationException:
IContestant.PlayGame("Shouldly"); Expected 1, Actual 0

Which is not super helpful. It would be better if printed close matches (or all recorded calls) like this:

Expected:
    IContestant.PlayGame("Shouldly");
Recorded:
    0: IContestant.PlayGame("Debugging"); 
    1: IContestant.PlayGame("Logging"); 
    2: IContestant.PlayGame("Drinking coffee"); 
    3: IContestant.PlayGame("Commenting out test");

I've added this in Shouldly: http://github.com/snappycode/shouldly

If you're happy with this format or something similar I can move this to Rhino.

whatupdave avatar Feb 22 '10 02:02 whatupdave