Re: Blog: Four Ways to test Expected Exceptions

"Brad Stiles" <[email protected]> Sat, 2 Aug 2008 12:47:46 -0400
Newsgroups gmane.comp.windows.dotnet.nunit.user,gmane.comp.windows.dotnet.nunit.devel
Message-ID <[email protected]>
> Comments?

I haven't had occasion to use this method of testing exceptions (though
to be fair, I can't remember the last time I used *any* method for
testing exceptions), but your explanation is clear, and its use seems
much clearer and more precise than the previous method.  I'd much rather
use the new than the old, but that's true for other assertions, too.

After some initial apathy ("skepticism" is really too strong to describe
what I felt), I've pretty much started using the constraint methods
exclusively over the Assert syntax, sometimes even changing old test
code when I need to change what it's testing.  It just makes my code so
much easier to read and parse.  One other developer on my team, for whom
"skepticism" wasn't strong *enough*, has also switched after really
looking at the resulting test code, and output. :)

Brad



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/