import junit.framework.TestCase;
public class TestJunitTest extends TestCase {// extends TestCase
public void testPrintMultipleLines() {// method name starts with 'test'
JunitTest prt = new JunitTest();
prt.prt("Bill");
// verify actual results equal those that are expected
assertEquals("Bill",prt.getString());
prt.prt("hello");
assertEquals("hello",prt.getString());
}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/