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

📄 examplejunit4test.java

📁 这个工具用于对JAVA的类文件进行覆盖率的测试
💻 JAVA
字号:
package org.hanselexample;import org.junit.Test;import static org.junit.Assert.*;/** * Coverage Test for the Example class. * This test covers all lines (including private/anonymous classes) * of the Example class. * * @author Niklas Mehner */public class ExampleJUnit4Test {         @Test public void absTest() {        Example example = new Example();        assertEquals("abs(1) should be 1.", 1, example.abs(1));        assertEquals("abs(-1) should be 1.", 1, example.abs(-1));        assertEquals("abs(0) should be 0.", 0, example.abs(0));      }     /**     * Test the Example.add() method. This also covers the code of the inner     * class.     */    @Test public void innerClassTest() {        Example example = new Example();          assertEquals("add(2, 3) should be 5.", 5, example.add(2, 3));    }    }

⌨️ 快捷键说明

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