四则运算程序的测试与封装

程序原型:之前的小学生四则运算程序

编程语言:java

测试代码如下:

 1 package SuanFa;
 2 
 3 import static org.junit.Assert.*;
 4 
 5 import org.junit.Test;
 6 
 7 public class CoreTest {
 8 
 9     @Test
10     public void testJia() {
11         Core core = new Core();
12         double a = core.jia(9, -3);
13         System.out.println(a);
14     }
15 
16     @Test
17     public void testJian() {
18         Core core = new Core();
19         double a = core.jian(9, -3);
20         System.out.println(a);
21     }
22 
23     @Test
24     public void testCheng() {
25         Core core = new Core();
26         double a = core.cheng(9, -3);
27         System.out.println(a);
28     }
29 
30     @Test
31     public void testChu() {
32         Core core = new Core();
33         double a = core.chu(9, -3);
34         System.out.println(a);
35     }
36 
37 }

测试截图:

此次结对编程已经更换新队员:黄雄俊,博客地址:http://www.cnblogs.com/huangxiongjun/

本次编程过程中,我主要负责程序的测试,另一名队员负责程序的封装。

原文地址:https://www.cnblogs.com/chenziyi/p/4469314.html