Beispiel #1
0
 def test_price_under_over_fifty(self):
     self.assertAlmostEqual(calculate_price(55, 5, 10), 47.17, places=2)
     self.assertAlmostEqual(calculate_price(55, 5, 15), 44.26, places=2)
     self.assertAlmostEqual(calculate_price(55, 5, 20), 41.34, places=2)
     self.assertAlmostEqual(calculate_price(55, 10, 10), 41.87, places=2)
     self.assertAlmostEqual(calculate_price(55, 10, 15), 38.95, places=2)
     self.assertAlmostEqual(calculate_price(55, 10, 20), 36.04, places=2)
 def test_price_under_ten(self):
     self.assertAlmostEqual(calculate_price(8, 5, 10), 8.28, places=2)
     self.assertAlmostEqual(calculate_price(8, 5, 15), 7.86, places=2)
     self.assertAlmostEqual(calculate_price(8, 5, 20), 7.43, places=2)
     self.assertAlmostEqual(calculate_price(8, 10, 10), 2.98, places=2)
     self.assertAlmostEqual(calculate_price(8, 10, 15), 2.56, places=2)
     self.assertAlmostEqual(calculate_price(8, 10, 20), 2.13, places=2)
Beispiel #3
0
 def test_price_under_between_ten_thirty(self):
     self.assertAlmostEqual(calculate_price(25, 5, 10), 26.50, places=2)
     self.assertAlmostEqual(calculate_price(25, 5, 15), 25.18, places=2)
     self.assertAlmostEqual(calculate_price(25, 5, 20), 23.85, places=2)
     self.assertAlmostEqual(calculate_price(25, 10, 10), 21.20, places=2)
     self.assertAlmostEqual(calculate_price(25, 10, 15), 19.88, places=2)
     self.assertAlmostEqual(calculate_price(25, 10, 20), 18.55, places=2)
Beispiel #4
0
 def test_price_under_between_thirty_fifty(self):
     self.assertAlmostEqual(calculate_price(45, 5, 10), 49.58, places=2)
     self.assertAlmostEqual(calculate_price(45, 5, 15), 47.19, places=2)
     self.assertAlmostEqual(calculate_price(45, 5, 20), 44.81, places=2)
     self.assertAlmostEqual(calculate_price(45, 10, 10), 44.28, places=2)
     self.assertAlmostEqual(calculate_price(45, 10, 15), 41.89, places=2)
     self.assertAlmostEqual(calculate_price(45, 10, 20), 39.51, places=2)
Beispiel #5
0
 def test_price_under_between_thirty_fifty(self):
     self.assertAlmostEqual(calculate_price(45, 5, 10), 50.11, places=2)
     self.assertAlmostEqual(calculate_price(45, 5, 15), 47.99, places=2)
     self.assertAlmostEqual(calculate_price(45, 5, 20), 45.87, places=2)
     self.assertAlmostEqual(calculate_price(45, 10, 10), 45.34, places=2)
     self.assertAlmostEqual(calculate_price(45, 10, 15), 43.49, places=2)
     self.assertAlmostEqual(calculate_price(45, 10, 20), 41.63, places=2)
 def test_price_under_over_fifty(self):
     value_under_over_fifty = 78.99
     shipping = 0.00
     self.assertAlmostEqual(((cc.calculate_price(value_under_over_fifty, 5,10) + shipping)*1.06), 70.59, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_over_fifty, 5, 15) + shipping)*1.06), 66.66, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_over_fifty, 5, 20) + shipping)*1.06), 62.74, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_over_fifty, 10,10) + shipping)*1.06), 65.82, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_over_fifty, 10, 15) + shipping)*1.06), 62.16, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_over_fifty, 10, 20) + shipping)*1.06), 58.50, places=2)
 def test_price_under_between_thirty_fifty(self):
     value_under_between_thirty_fifty = 38.99
     shipping = 11.95
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_thirty_fifty, 5,10) + shipping)*1.06), 45.09, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_thirty_fifty, 5, 15) + shipping)*1.06), 43.29, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_thirty_fifty, 5, 20) + shipping)*1.06), 41.49, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_thirty_fifty, 10,10) + shipping)*1.06), 40.32, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_thirty_fifty, 10, 15) + shipping)*1.06), 38.79, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_thirty_fifty, 10, 20) + shipping)*1.06), 37.25, places=2)
 def test_price_under_between_ten_thirty(self):
     value_under_between_ten_thirty = 18.99
     shipping = 7.95
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_ten_thirty, 5,10) + shipping)*1.06), 21.77, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_ten_thirty, 5, 15) + shipping)*1.06), 21.03, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_ten_thirty, 5, 20) + shipping)*1.06), 20.29, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_ten_thirty, 10,10) + shipping)*1.06), 17.00, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_ten_thirty, 10, 15) + shipping)*1.06), 16.53, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_between_ten_thirty, 10, 20) + shipping)*1.06), 16.05, places=2)
 def test_price_under_ten(self):
     value_under_ten = 8.99
     shipping = 5.95
     self.assertAlmostEqual(((cc.calculate_price(value_under_ten,5,10) + shipping)*1.06), 10.11, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_ten, 5, 15) + shipping)*1.06), 9.90, places=2)
     self.assertAlmostEqual(((cc.calculate_price(value_under_ten, 5, 20) + shipping)*1.06), 9.69, places=2)