keep the bar green to keep the code clean
单元测试不是证明您是对的,而是证明您没有错误。(因为有些地方可能没有测试到)
1 在Junit3.8中类必须继承TestCase
2 单元测试满足如下原则
1)public
2)void
3)无参数
4)测试方法必须以test开头,testxx(xx可以随便写)
eg.TestCase.assertEquals("1", hello.print());
或者是调用Assert的静态方法
Assert.assertEquals("1", hello.print());
Assert.fail()
浙公网安备 33010602011771号