JsUnit 1.3 |
![]() |
![]() |
The other way to check that an expected exception is thrown is:
try { this.shouldThrow(); } catch (ex) { if (ex instanceof SpecialException) return; else throw ex; } this.fail("Expected SpecialException");
To use ExceptionTestCase, create a TestCase like:
new ExceptionTestCase("testShouldThrow", SpecialException);
Public Member Functions | |
void | ExceptionTestCase (String name, Function clazz) |
Constructor. | |
Public Attributes | |
Function | mClass |
Save the class. |
Constructor.
The constructor is initialized with the name of the test and the expected class to be thrown.
name | The name of the test case. | |
clazz | The class to be thrown. |
Save the class.
JsUnit © 1999, 2000, 2001, 2002, 2003, 2006, 2007 by Jörg Schaible
|
Generated on Fri Oct 19 23:11:00 2007 for JsUnit by doxygen 1.5.2
|