def test_square_method_calculator(self): test_data = CsvReader('/src/Unit Test Square.csv').data #pprint(test_data) for row in test_data: self.assertEqual(self.calculator.sqr(row['Value 1']), float(row['Result'])) self.assertEqual(self.calculator.result, float(row['Result'])) test_data.clear()
def test_division_method_calculator(self): test_data = CsvReader('/src/Unit Test Division.csv').data #pprint(test_data) for row in test_data: self.assertEqual( self.calculator.divide(row['Value 1'], row['Value 2']), float(row['Result'])) self.assertEqual(self.calculator.result, float(row['Result'])) test_data.clear()
def test_subtraction_method_calculator(self): test_data = CsvReader('/src/Unit Test Subtraction.csv').data #pprint(test_data) for row in test_data: self.assertEqual( self.calculator.subtract(row['Value 1'], row['Value 2']), int(row['Result'])) self.assertEqual(self.calculator.result, int(row['Result'])) test_data.clear()