首页 > 其他 > 详细

第三次作业

时间:2016-09-10 22:18:08      阅读:198      评论:0      收藏:0      [点我收藏+]

Junit4测试:

<dependency>                    

                      <groupId>junit</groupId>                    
                      <artifactId>junit</artifactId>                    
                      <version>4.8.2</version>                    
                      </dependency>                    
                      <dependency>                    
                      <groupId>org.jmock</groupId>                    
                      <artifactId>jmock</artifactId>                    
                      <version>2.5.1</version>                    
                      </dependency>                    
                      <dependency>                    
                      <groupId>org.jmock</groupId>                    
                      <artifactId>jmock-junit4</artifactId>                    
                      <version>2.5.1</version>                    
                      </dependency>                    
                      <dependency>                    
                      <groupId>org.hamcrest</groupId>                    
<artifactId>hamcrest-core</artifactId>
                      <version>1.2.1</version>                    
                      </dependency>                    
                        package cn.javass;                      
                        import org.junit.Assert;                      
                        import org.junit.Test;                      
                        public class TestDivide1 {                      
                        @Test                      
                        public void test1(){                      
                        Divide divide = new Divide();                      
                        final int expected = 3;                      
                        final int actual = divide.devide(7, 2);                      
                        Assert.assertEquals(expected, actual);                      
                        }                      
                        }
运行测试类:
 
技术分享
测试结果:
 
技术分享

第三次作业

原文:http://www.cnblogs.com/cuiguoang/p/5860314.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!