simpleaddtest.java
来自「《基于Eclipse的开源框架技术与实战》[第2章]随书源码」· Java 代码 · 共 48 行
JAVA
48 行
package com.free.test.simple;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* <p>Title: Eclipse Plugin Development</p>
* <p>Description: Free download</p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: Free</p>
* @author gan.shu.man
* @version 1.0
*/
public class SimpleAddTest extends TestCase {
/**
* 执行初始化操作
* */
protected void setUp() throws Exception {
//TODO test方法执行前的环境初始化
}
/**
* 执行清理操作
* */
protected void tearDown() throws Exception {
//TODO test方法执行后的环境清理
}
/**
* 测试SimpleAdd类的StringAdd方法
* */
public void testIntegerAdd() {
SimpleAdd simpleAdd = new SimpleAdd();
assertEquals(new Integer(9), simpleAdd.integerAdd(new Integer(4),
new Integer(5)));
}
public void testStringAdd() {
SimpleAdd simpleAdd = new SimpleAdd();
assertEquals(new Integer(9), simpleAdd.StringAdd("4","5"));
}
//其它test方法的实现
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?