zoukankan      html  css  js  c++  java
  • TextForfogit

    caculator
    package com.example.liuy.textforforgit;

    /**
    * Created by liuY on 2017/3/13.
    */

    public class caculator {
    public double sum(double a,double b){
    return a+b;
    }

    public double substract(double a,double b) {
    return a-b;
    }
    public double divide(double a,double b){
    return a/b;
    }
    public double multiply(double a,double b){
    return a*b;
    }
    }
    caculatorText
    package com.example.liuy.textforforgit;

    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;

    import static org.junit.Assert.*;

    /**
    * Created by liuY on 2017/3/13.
    */
    public class caculatorTest {


    private caculator mcaculator;
    @Before
    public void setUp() throws Exception {
    mcaculator=new caculator();
    }
    @After
    public void tearDown() throws Exception {

    }

    @Test
    public void sum() throws Exception {
    assertEquals(20d,mcaculator.sum(10d,10d),0);


    }

    @Test
    public void substract() throws Exception {
    assertEquals(1d,mcaculator.substract(5d,4d),0);

    }

    @Test
    public void divide() throws Exception {
    assertEquals(4d,mcaculator.divide(20d,5d),0);

    }

    @Test
    public void multiply() throws Exception {
    assertEquals(100d,mcaculator.multiply(50d,2d),0);

    }



    }

    
    
  • 相关阅读:
    模块二
    lambda map() filter() zip()练习
    装饰器
    函数模块回顾
    连接不同数据OleDb(不完整)
    连接不同的数据库
    连接数据库ORACLE(不完整)
    多数据之间的连接操作ODBC(不完整)
    ora0131
    ORACLE linux 下 sqlplus命令
  • 原文地址:https://www.cnblogs.com/u1118746/p/6561894.html
Copyright © 2011-2022 走看看