예제 #1
0
 public void subTest()
 {
     Calculator calc = new Calculator('-');
     double result = calc.calc(3.3, 5.5);
     Assert.IsTrue(result == -2.2);
 }
예제 #2
0
 public void multiTest()
 {
     Calculator calc = new Calculator('*');
     double result = calc.calc(3.3, 5.5);
     Assert.IsTrue(result == 18.15);
 }
예제 #3
0
 public void divTest1()
 {
     Calculator calc = new Calculator('/');
     double result = calc.calc(3.3, 5.5);
     Assert.IsTrue(result == 0.6);
 }
예제 #4
0
 public void divTest2()
 {
     Calculator calc = new Calculator('/');
     double result = calc.calc(3.3, 0);
     Assert.IsTrue(Double.IsInfinity(result));
 }
예제 #5
0
 public void addTest()
 {
     Calculator calc = new Calculator('+');
     double result = calc.calc(3.3, 5.5);
     Assert.IsTrue(result == 8.8);
 }