📄 testmath.java
字号:
package junit.example;
import junit.framework.TestCase;
public class Testmath extends TestCase {
private math math = null;
public Testmath(String name) {
super(name);
}
protected void setUp() throws Exception {
super.setUp();
/**@todo verify the constructors*/
math = new math();
}
protected void tearDown() throws Exception {
math = null;
super.tearDown();
}
public void testAdd() {
int a =10;
int b = 0;
int expectedReturn = 0;
int actualReturn = math.add(a, b);
assertEquals("return value", new Integer(expectedReturn), new Integer(actualReturn));
/**@todo fill in the test code*/
}
public void testSubtract() {
int a = 1;
int b = 0;
int expectedReturn = 70;
int actualReturn = math.subtract(a, b);
//assertEquals("return value", expectedReturn, actualReturn);
/**@todo fill in the test code*/
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -