Putting test cases into a suite of tests
Define a static method called
suite() as follows:
- If you want to explicitly list the tests to include the
following in MoneyTest :
public static Test suite() {
TestSuite suite= new TestSuite();
suite.addTest(new MoneyTest("testEquals"));
suite.addTest(new MoneyTest("testSimpleAdd"));
return suite;
}
- If you want all methods starting with "test".
public static Test suite() {
return new TestSuite(MoneyTest.class);
}
previous |
start |
next .... [Slide 10] ....