Expected Unhandled Exceptions

Wade Barnes <[email protected]> Fri, 11 Jul 2008 09:19:38 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Hi, 
Is there any way to tell a particular test to expect an unhandled exception; one that would normally be indicated through the AppDomain.UnhandledException event?
I am testing code that uses AppDomains to isolate code.  One of the tests purposely causes an unhandled exception in one of these AppDomains to ensure it is properly reported and acted upon by the code managing the AppDomains; therefore I am expecting an unhandled exception to occur. 
The issue:
The test itself passes. 
However,
When using the GUI runner the test bar goes Red and the unhandled exception is reported in the output list.
When using the Console runner this same unhandled exception causes the runner to return a code of -100; this ends up failing our nightly build.
What I would like to do:
I would like to be able to indicate, for a particular test, that an unhandled exception is expected.  I would then expect the test to behave similarly to any other test expecting an exception; if received it happy goes about the remained of its testing business, otherwise it fails because it did not receive the expected exception.  Additionally when such a test is encountered I would expect the test bar in the GUI not to turn Red and the unhandled exception not to be reported in the output list; similarly I would expect the Console runner not to return -100.
Wade

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users