Junit测试编程

来源:互联网 发布:大数据的解决方案 编辑:程序博客网 时间:2024/05/16 12:25
public class CountTest extends TestCase {private Count count;//初始化方法,执行CountTest类时,先来执行该方法protected void setUp() throws Exception {super.setUp();count = new Count();}//清理方法,测测结束后执行该方法protected void tearDown() throws Exception {super.tearDown();count = null;}//在被测试的方法名钱自动加入test并使方法名的第一个字母大写public void testEncrypt() {  assertEquals(“测试testEncrypt()方法失败!”,count.encrypt(10),”YXQ120″);}}
0 0
原创粉丝点击