testemployee.java~3~

来自「数据库应用程序.它比较全面的含盖了JAVA应用程序与数据库之间通讯的全过程.本程」· JAVA~3~ 代码 · 共 35 行

JAVA~3~
35
字号
package chapter25.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.recordObject(employee);
        employee = new Employee(id, name, age);
        assertTrue(comparisonFixture1.compareObject(employee));

    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?