def float_value_test_for_absolute_discount(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(100.0, 10.0, 'absolute') self.assertEqual(10.0, result)
def test_ten_percent_discount(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(100,10,'percent') self.assertEqual(10.0, result)
def absolute_discount_test(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(250, 5, 'absolute') self.assertEqual(5, result)
def float_value_test_for_percentage_discount(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(100.0, 10.0, 'percent') self.assertEqual(10.0, result)
def excessive_absolute_discount_amount_test(self): discount_calculator = DiscountCalculator() self.assertRaises(ValueError, discount_calculator.calculate, 100, 125, 'absolute')
def test_ten_percent_discount(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(100, 10, 'percent') self.assertEqual(10.0, result)
def excessive_percentage_discount_amount_test(self): discount_calculator = DiscountCalculator() self.assertRaises(ValueError, discount_calculator.calculate, 250, 110, 'percent')
def discount_type_test(self): discount_calculator = DiscountCalculator() self.assertRaises(ValueError, discount_calculator.calculate, 250, 5, 'random')
def five_dollar_discount_test(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(250, 5, 'dollar') self.assertEqual (5, result)
def floating_point_absolute_discount_test(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(250.0,5.0,'dollar') self.assertEqual(5.0, result)
def floating_point_percentage_discount_test(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(100.0,10.0,'percent') self.assertEqual(10.0, result)
def fifteen_percent_discount_test(self): discount_calculator = DiscountCalculator() result = discount_calculator.calculate(100, 15, 'percent') self.assertEqual (15, result)