Re: Determining if a test passed or failed

"Charlie Poole" <[email protected]> Mon, 28 Jul 2008 10:16:05 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <009101c8f0d5$a2058470$6401a8c0@ferrari>
Hi Michael, 

> What I've done is use reflection in a test to examine the 
> class that the test fixture is supposed to cover.  Two issues 
> that we like to cover are
> 
> a) are all public constants right?  It wouldn't do to have an 
> accidental typo in an xml name tag.
> b) are all public methods null/max/min safe?
> 
> Use reflection to look up all the things of interestand then 
> iterate through the collection checking constants or firing 
> off method calls with crazy values.

Interesting... I've been thinking myself about how NUnit could
support this sort of testing. Any ideas? Assertions/constraints
you would like to see? Or would care to contribute?

> I've looked at using the same framework to examine if all 
> methods are tested, but haven't done anything satisfactory.  
> It is quite easy to write a list of known methods that will 
> automatically fail if a new method is added to the class 
> under test, but the list of methods that are known to be 
> tested has to be updated manually.

I've used naming conventions and the Description property to
tie tests to what was being tested. But of course, that only
works if people fill in the right values.

Charlie



-------------------------------------------------------------------------
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=/