The ultimate ExceptionAssert.Throws() method

A while ago I published a post titled Pimp your VSTT exception tests in which I pointed out some disadvantages of VSTT’s declarative approach to testing for exceptions and provided an alternative. I recently gave this some more thought while writing some new tests and noticed that my original version could be significantly improved by…

0

Pimp your VSTT exception tests

Writing unit tests in VSTT is great since it comes with a nice unit testing framework and the test tools are neatly integrated into Visual Studio. There is one exception though: Exception testing (yes, that pun was intended). Consider the following example: public class Foo {     private object[] _array;       public Foo(object[] array)…

5