Exemple #1
0
 def test_sqrt(self):
     test_data = csvreader('Tests/csvfiles/TestSquareRoot.csv').data
     for row in test_data:
         result = float(row['Result'])
         self.assertAlmostEqual(self.calculator.Sqrt(row['Value 1']),
                                result)
         self.assertAlmostEqual(self.calculator.result, result)
Exemple #2
0
 def test_div(self):
     test_data = csvreader('Tests/csvfiles/TestDivision.csv').data
     for row in test_data:
         result = float(row['Result'])
         self.assertAlmostEqual(
             self.calculator.Division(row['Value 1'], row['Value 2']),
             result)
         self.assertAlmostEqual(self.calculator.result, result)
Exemple #3
0
 def test_times(self):
     test_data = csvreader('Tests/csvfiles/TestMultiplication.csv').data
     for row in test_data:
         result = float(row['Result'])
         self.assertEqual(
             self.calculator.Multiplication(row['Value 1'], row['Value 2']),
             result)
         self.assertEqual(self.calculator.result, result)
 def setUp(self) -> None:
     self.csv_reader = csvreader('Tests/csvfiles/TestAddition.csv')