You need to create a new separate class XText if our original programs class name is X.
There are three things you must do as you set up this class in order to run your tests:
- Import junit.framework.*.
- Extend TestCase.
- Provide a constructor with a single String parameter. This constructor should call the TestCase constructor with the parameter.
Here is a minimal class that demonstrates the structure of classes derived from TestCase:
import junit.framework.*;
public class XTest extends TestCase {
public XTest(String name) {
super(name);
}
public void Y() { ......... }
}
No comments:
Post a Comment