HttpContext TestTest: Can I mock HttpContext, set a value, and get the value, in this case Error
Result: Just Mock crashes when it tries to mock HttpContext.
SqlConnection TestTest: Can I mock a SqlConnection and open a connection with out really opening a connection.
Result: Just Mock was able to create the mock without crashing but when I try to set alternate functionality to the Open method, recording that I called Open, it crashes saying invalid connection string. My question is why does it care about a connection string when I’m setting behavior, unless I’m missing how to set this up.
ConclusionAs you can see in the examples the syntax is nice and simple, unfortunately Just Mock failed to pass either of my test and to be honest I’m not surprised, it’s in early beta and I tested it against the hardest problems I can think of to solve, something that none of the other mocking frameworks I have looked at even attempt.
What really impressed me was that while working on this I tweeted about having problems and within a couple of hours @hkosev (Hristo Kosev) from Telerik, who isn’t one of my followers, tweeted me asking what I was doing to get the errors and asked me if I would mind sending him the source for what I was doing so they could solve the problem, without even asking for help, very nice.
As always here is the link to my source code.