testsubsection1.java~1~
来自「数据库应用程序.它比较全面的含盖了JAVA应用程序与数据库之间通讯的全过程.本程」· JAVA~1~ 代码 · 共 51 行
JAVA~1~
51 行
package chapter25;
import junit.framework.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class TestSubsection1 extends TestCase {
private Subsection subsection = null;
protected void setUp() throws Exception {
super.setUp();
subsection = new Subsection();
}
protected void tearDown() throws Exception {
subsection = null;
super.tearDown();
}
public void testGetValue() {
int d1 = -3, y1 = 3;
int d2 = -2, y2 = 4;
int d3 = 0, y3 = 100;
int d4 = 2, y4 = 8;
int d5 = 33, y5 = Integer.MAX_VALUE;
assertEquals(y1, subsection.getValue(d1));
assertEquals(y2, subsection.getValue(d2));
assertEquals(y3, subsection.getValue(d3));
assertEquals(y4, subsection.getValue(d4));
assertEquals(y5, subsection.getValue(d5));
}
public void testSign() {
double d1 = -1.0, d2 = 0.0, d3 = 1.0;
int y1 = 1, y2 = 0, y3 = 1;
assertEquals(y1, subsection.sign(d1));
assertEquals(y1, subsection.sign(d1));
assertEquals(y1, subsection.sign(d1));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?