コード例 #1
0
 def test_square_root(self):
     test_row_list = read_csv("square_root.csv")
     for row in test_row_list:
         a = int(row[0])
         b = Decimal(row[1])
         #c=float(row[2])
         exp_result = self.calculator.square_root(a)
         self.assertEqual(exp_result, b)
コード例 #2
0
 def test_multiply(self):
     test_row_list = read_csv("multiplication.csv")
     for row in test_row_list:
         a = int(row[0])
         b = int(row[1])
         c = int(row[2])
         exp_result = self.calculator.multiply(a, b)
         self.assertEqual(exp_result, c)
コード例 #3
0
 def test_divide(self):
     test_row_list = read_csv("division.csv")
     for row in test_row_list:
         a = int(row[0])
         b = int(row[1])
         c = float(row[2])
         exp_result = self.calculator.divide(a, b)
         self.assertEqual(exp_result, c)
コード例 #4
0
 def test_subtract(self):
     test_row_list = read_csv("subtraction.csv")
     for row in test_row_list:
         a = int(row[0])
         b = int(row[1])
         c = int(row[2])
         exp_result = self.calculator.subtract(a, b)
         self.assertEqual(exp_result, c)