예제 #1
0
 def test_discount_greater_than_total(self):
     calc = Calculator()
     self.assertRaises(ValueError, calc.calc_discount, 250, 300, 'dollar')
예제 #2
0
 def test_calculate_ten_percent_discount(self):
     calc = Calculator()
     result = calc.calc_discount(100, 10, "percentage")
     self.assertEqual(10, result)
예제 #3
0
 def test_floating_point_absolute_discount_test(self):
     calc = Calculator()
     result = calc.calc_discount(250.0, 5.0, 'dollar')
     self.assertEqual(5.0, result)
예제 #4
0
 def test_percentage_greater_than_100(self):
     calc = Calculator()
     self.assertRaises(ValueError, calc.calc_discount, 250, 200,
                       'percentage')
예제 #5
0
 def test_raise_error(self):
     calc = Calculator()
     self.assertRaises(ValueError, calc.calc_discount, 250, 5, '$')
예제 #6
0
 def test_floating_point_percentage_discount_test(self):
     calc = Calculator()
     result = calc.calc_discount(100.0, 10.0, 'percentage')
     self.assertEqual(10.0, result)
예제 #7
0
 def test_calculate_fifteen_dolar_discount(self):
     calc = Calculator()
     result = calc.calc_discount(100, 15, "dollar")
     self.assertEqual(15, result)
예제 #8
0
 def test_five_dollar_discount_test(self):
     calc = Calculator()
     result = calc.calc_discount(250, 5, 'dollar')
     self.assertEqual(5, result)
예제 #9
0
 def test_calculate_ten_percent_discount(self):
     calc = Calculator()
     result = calc.calc_discount(100, 10, "percentage")
     self.assertEqual(10, result)
예제 #10
0
 def test_floating_point_absolute_discount_test(self):
     calc = Calculator()
     result = calc.calc_discount(250.0,5.0,'dollar')
     self.assertEqual(5.0, result)
예제 #11
0
 def test_floating_point_percentage_discount_test(self):
     calc = Calculator()
     result = calc.calc_discount(100.0,10.0,'percentage')
     self.assertEqual(10.0, result)
예제 #12
0
 def test_five_dollar_discount_test(self):
     calc = Calculator()
     result = calc.calc_discount(250, 5 ,'dollar')
     self.assertEqual(5, result)
예제 #13
0
 def test_calculate_fifteen_dolar_discount(self):
     calc = Calculator()
     result = calc.calc_discount(100, 15, "dollar")
     self.assertEqual(15, result)