Category Archives: Unit Testing

F# Object Expressions vs Mocking Libraries: Am I Missing Something?

Object expressions are a cool feature of F#. For those unfamiliar, they allow you to easily instantiate anonymous classes: There are times when it’s useful to instantiate anonymous classes in this fashion (a topic for another post), but I’m not convinced that mocking is one of them. However, based on based on a couple of […]

Also posted in F#, testing | 2 Comments

Testing for Exceptions in Unit Test Frameworks

In MSTest and nUnit, the typical way to test for exceptions is by using the [ExpectedException] attribute on a test method.  I’ve always found this to be a little annoying, but it was just recently that I decided to do something better.  Unsurprisingly, I’m not the first one to have this thought; xUnit uses this […]

Also posted in C# | 1 Comment