JsUnit 1.3
Project Developer Home doxygen

ExceptionTestCase Class Reference

Inheritance diagram for ExceptionTestCase:

Inheritance graph
[legend]
Collaboration diagram for ExceptionTestCase:

Collaboration graph
[legend]
List of all members.

Detailed Description

A TestCase that expects an exception of class mClass to be thrown.

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 & Destructor Documentation

void ExceptionTestCase::ExceptionTestCase ( String  name,
Function  clazz 
)

Constructor.

The constructor is initialized with the name of the test and the expected class to be thrown.

Parameters:
name The name of the test case.
clazz The class to be thrown.


Member Data Documentation

Function ExceptionTestCase::mClass

Save the class.


The documentation for this class was generated from the following file:
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