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)
예제 #5
0
 def excessive_absolute_discount_amount_test(self):
     discount_calculator = DiscountCalculator()
     self.assertRaises(ValueError, discount_calculator.calculate, 100, 125,
                       'absolute')
예제 #6
0
 def test_ten_percent_discount(self):
     discount_calculator = DiscountCalculator()
     result = discount_calculator.calculate(100, 10, 'percent')
     self.assertEqual(10.0, result)
예제 #7
0
 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)
예제 #8
0
 def excessive_percentage_discount_amount_test(self):
     discount_calculator = DiscountCalculator()
     self.assertRaises(ValueError, discount_calculator.calculate, 250, 110,
                       'percent')
예제 #9
0
 def discount_type_test(self):
     discount_calculator = DiscountCalculator()
     self.assertRaises(ValueError, discount_calculator.calculate, 250, 5,
                       'random')
예제 #10
0
 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)
예제 #11
0
 def absolute_discount_test(self):
     discount_calculator = DiscountCalculator()
     result = discount_calculator.calculate(250, 5, 'absolute')
     self.assertEqual(5, result)
	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)