import junit.framework.TestCase;
public class Test extends TestCase {
public Test(String name) {
super(name);
}
public void setUp() {}
public void tearDown(){}
public void testHelloWorld() {
// Test Code goes here
String hello = "Hello";
String world = "world";
assertEquals("Hello world", hello+world);
}
}
测试被执行的结果显示失败的情况如下:
Time: 0.01
There was 1 failure:
1) testHelloWorld(Test) "expected: but was:"
FAILURES!!!Tests run: 2, Failures: 1, Errors: 0