码迷,mamicode.com
首页 > 其他好文 > 详细

第三次作业

时间:2016-09-10 22:20:49      阅读:153      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!