![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Junit
文章平均质量分 53
Nazarite_KakaLuoTo
我是一个性格比较内向,有点技术宅,热爱编程,读书,健身,泰拳等。
展开
-
使用MyEclipse进行单元测试(基础)
一、新建待测试的类package com.sunft.junit4;/** * 待测试的类 * @author sunft * */public class T { public int add(int x, int y) { return x + y; } public static void main(String[] args) { int z = new原创 2017-12-17 14:51:37 · 962 阅读 · 0 评论 -
使用Junit和hamcrest包进行单元测试
下载hamcrest-all-1.3.jar导入到工程中,编写下面的方法进行测试:package com.sunft.junit4.test;import static org.junit.Assert.*;import static org.hamcrest.Matchers.*;import org.junit.Test;import com.sunft.junit4.T;原创 2017-12-17 15:00:45 · 1213 阅读 · 0 评论 -
JUnit中的注解(Annotation)
新建待测试类:package com.sunft.junit4;/** * 待测试的类 * @author sunft * */public class T { public int add(int x, int y) { return x + y; } public int divide(int x, int y) { return x / y; }原创 2017-12-17 15:14:02 · 473 阅读 · 0 评论