⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testmath.java

📁 junit中的软件设计模式 源代码,看了挺有收获的
💻 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 + -