Posts

Showing posts from October, 2010

What a Difference a Clear Error Message Makes

Let me be the first to say (and everyone should echo in harmony) that this issue was 100% my fault. Today I spent at least an hour of my life trying to track down an issue caused, simply, by the fact that I was trying to mock a sealed class without realizing it… The point of this post is not to illustrate what went wrong. The point of this post is to show the error messages displayed by two popular mocking frameworks and highlight the benefit of clear messages. Recently I’ve been using Telerik’s JustMock framework but in the past MOQ has been my framework of choice. I’ve always found MOQ’s messages useful – it seems like the developers put a lot of thought into what the user sees – and after struggling to debug the issue for a while I figured I’d switch frameworks (for this individual test) to see if it would provide any more insight. Take a look at the difference between error messages. Which one would you prefer? JustMock System.InvalidProgramException : Common Language Ru