Vladimir,

You would have to ask Charlie Poole, but I believe the idea of the SetUp and TearDown 
methods is to provide support code that is outside of the test.  Nevertheless, you can 
still put Assert calls inside the SetUp and TearDown methods to do your own checks.  
If one of those Assert fails, then an NUnit failure will be reported.

For example, in my application, we are using a NAnt script to run an NUnit test of 
software that is driving hardware.  However, if the hardware is in the wrong state, 
there is no use running the test.  Therefore, in each TestFixtureSetUp method (and we 
have about 40 test files), there is a check to see if the hardware is still "alive" 
and capable of responding to the software.  If the TestFixtureSetUp finds the hardware 
is not alive, it assert with an appropriate message.  NUnit reports a test failure.  
NAnt reports that NUnit returned with an error code.

You could even wrap the body of the SetUp method in a try{} block then put an 
Assert.Fail() in the catch{} block if you want to catch unexpected exceptions.

Merrill


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to