📄 testemployee.java~12~
字号:
package chapter24.db;
import junit.framework.*;
import fixture.*;
public class TestEmployee extends TestCase {
private Employee employee = null;
ComparisonFixture1 comparisonFixture1;
protected void setUp() throws Exception {
super.setUp();
employee = new Employee("0004", "王五", 23);
comparisonFixture1 = new ComparisonFixture1(this);
comparisonFixture1.setUp();
}
protected void tearDown() throws Exception {
employee = null;
comparisonFixture1.tearDown();
comparisonFixture1 = null;
super.tearDown();
}
public void testEmployee() {
String id = "0004";
String name = "王五";
int age = 23;
comparisonFixture1.print(employee.getId());
comparisonFixture1.recordObject(employee);
employee = new Employee(id, name, age);
assertTrue(comparisonFixture1.print(employee.getId()));
assertTrue(comparisonFixture1.compareObject(employee));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -