woensdag 15 december 2010

nunit - ignore a test at runtime

There are 4 exceptions that nunit uses to tell the result of a test. These are: TimeoutException, AssertException, SuccessException, and IgnoreException. You can use these from within your nunit test functions, but for the IgnoreException there's also an attribute to decorate your test function with. However, you use the attribute to ignore a test function if you knew in advance it was supposed to be ignored. But if you don't happen to know if you want to ignore / skip a test function beforehand you may want to ignore a test at runtime instead. So use the IgnoreException to break off your test if, while running the test, you find out it had better be skipped.

Geen opmerkingen:

Een reactie posten