Exemple #1
0
 def test_1(self):
     """This test is checking to make sure the checkout price is equal to 33.45 (since they are a premium member"""
     p1 = Store.Product("889", "Rodent of unusual size",
                        "when a rodent of the usual size just won't do",
                        33.45, 8)
     c1 = Store.Customer("Yinsheng", "QWF", True)
     myStore = Store.Store()
     myStore.add_product(p1)
     myStore.add_member(c1)
     myStore.add_product_to_member_cart("889", "QWF")
     result = myStore.check_out_member("QWF")
     self.assertEqual(result, 33.45)
Exemple #2
0
 def test_2(self):
     """This test is checking to make sure the program is charging the extra 7% shipping cost for non-premium
     members"""
     p1 = Store.Product("889", "Rodent of unusual size",
                        "when a rodent of the usual size just won't do",
                        33.45, 8)
     c1 = Store.Customer("Yinsheng", "QWF", False)
     myStore = Store.Store()
     myStore.add_product(p1)
     myStore.add_member(c1)
     myStore.add_product_to_member_cart("889", "QWF")
     result = myStore.check_out_member("QWF")
     self.assertEqual(result, (33.45 * 1.07))
 def test_5(self):
     c1 = Store.Customer("Yinsheng", "QWF", False)
     name = c1.get_name()
     self.assertIn(name, "Yinsheng")
 def test_4(self):
     c1 = Store.Customer("Yinsheng", "QWF", False)
     membership = c1.is_premium_member()
     self.assertIs(membership, False)
Exemple #5
0
 def test_5(self):
     customer = Store.Customer("Ben", "GGF", True)
     self.assertEqual(customer.is_premium_member(), True)
Exemple #6
0
 def test_2(self):
     customer = Store.Customer("Sam", "FRW", False)
     self.assertNotEqual(customer.get_name(), "Samantha")