Пример #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)