结对编程作业

项目成员

丁树乐 201521123024
郑佳明 201521123029

项目码云地址:https://gitee.com/m1n9/in

思维导图

部分代码

package calculation;

import static org.junit.Assert.*;

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

public class CalcFunctionTest {

    CalcFunction calc = new CalcFunction();
    @Before
    public void setUp() throws Exception {
    }
    @Test
    public void testCalc() {
    	
    }
    @Test
    public void testAdd() {
        calc.add("1+2");
        assertEquals("3" , calc.getResult());
        calc.add("2/3+2/3");
        assertEquals("4/3" , calc.getResult());

    }
    @Test
    public void testSubstract() {
        calc.substract("3-1");
        assertEquals("2", calc.getResult());
        calc.substract("2/3-1/3");
        assertEquals("1/3", calc.getResult());

    }
    @Test
    public void testMultiply() {
        calc.multiply("2*3");
        assertEquals("6" , calc.getResult());
        calc.multiply("2/3*1/3");
        assertEquals("2/9" , calc.getResult());
    }
    @Test
    public void testDivide() {
        calc.divide("8÷4");
        assertEquals("2", calc.getResult());
        calc.divide("1/4÷1/4");
        assertEquals("1", calc.getResult());
    }

}
package calculation;

import static org.junit.Assert.*;

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

public class CalcTest {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void test() {
		fail("Not yet implemented");
	}

}

结果截图

码云提交

团队合作

小结

刚开始结对编程还有些不适应,需要多多练习

P2P编程时间

posted on 2018-03-25 21:30  happy丶tree  阅读(142)  评论(0编辑  收藏  举报