testmyclass3.java~2~
来自「junit编程实例。适合初学者。使用jbuilder开发。」· JAVA~2~ 代码 · 共 28 行
JAVA~2~
28 行
package Test;
import junit.framework.*;
public class TestMyClass3 extends TestCase {
private MyClass myClass = null;
protected void setUp() throws Exception {
super.setUp();
/**@todo verify the constructors*/
myClass = new MyClass();
}
protected void tearDown() throws Exception {
myClass = null;
super.tearDown();
}
public void testReadFile() {
String fileName = "file.txt";
String expectedReturn = "abc";
String actualReturn = myClass.readFile(fileName);
assertEquals("return value", expectedReturn, actualReturn);
/**@todo fill in the test code*/
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?