JsUnit 1.3 |
![]() |
![]() |
To define a test case
setUp
tearDown
. Each test runs in its own fixture so there can be no side effects among test runs.
For each test implement a method which interacts with the fixture. Verify the expected results with assertions specified by calling assertTrue
with a boolean or one of the other assert functions.
Once the methods are defined you can run them. The framework supports both a static and more generic way to run a test. In the static way you override the runTest method and define the method to be invoked. The generic way uses the JavaScript functionality to enumerate a function's methods to implement runTest
. In this case the name of the case has to correspond to the test method to be run.
The tests to be run can be collected into a TestSuite. JsUnit provides several test runners which can run a test suite and collect the results. A test runner expects a function FileNameSuite
as the entry point to get a test to run.
Public Member Functions | |
void | TestCase (String name) |
Constructs a test case with the given name. | |
void | setUp () |
Set up the environment of the fixture. | |
void | tearDown () |
Clear up the environment of the fixture. | |
Public Attributes | |
int | mName |
void TestCase::TestCase | ( | String | name | ) |
Constructs a test case with the given name.
name | The name of the test case. |
void TestCase::setUp | ( | ) |
Set up the environment of the fixture.
void TestCase::tearDown | ( | ) |
Clear up the environment of the fixture.
int TestCase::mName |
JsUnit © 1999, 2000, 2001, 2002, 2003, 2006, 2007 by Jörg Schaible
|
Generated on Fri Oct 19 23:11:25 2007 for JsUnit by doxygen 1.5.2
|