规范:java
断言:assertEquals();assertFalse();等yii
示例:测试
class DemoTest{ @Before public void bef(){ Demo demo = new Demo();//Test方法执行器都会执行 } @Test public void testFunc(){ int result = new Demo.func();//使用匿名对象 int result1 = demo.func(); Assert.assertEquals(1,result);//断言 } }
静态引入:import static org.junit.Assert.*表示静态引入,把Assert下的方法引入,能够直接调用方法.net
参考博客:code
http://blog.csdn.net/mao520741111/article/details/51462215htm
http://blog.sina.com.cn/s/blog_67aaf4440100zjye.html对象
http://www.yiibai.com/junit/blog
http://www.51testing.com/html/59/305559-211568.htmlget