def test_offer_price_items_not_in_order(): checkout = Checkout() checkout.add_item(item_a) checkout.add_item(item_a) checkout.add_item(item_b) checkout.add_item(item_a) assert checkout.get_total_cost() == 130 + 30
def test_offer_two_offers(): checkout = Checkout() checkout.add_item(item_b) checkout.add_item(item_b) checkout.add_item(item_a) checkout.add_item(item_a) checkout.add_item(item_a) assert checkout.get_total_cost() == 45 + 130
def test_offer_price_tree_items_duplicate_offer(): checkout = Checkout() checkout.add_item(item_a) checkout.add_item(item_a) checkout.add_item(item_a) checkout.add_item(item_a) checkout.add_item(item_a) checkout.add_item(item_a) assert checkout.get_total_cost() == 150 + 130
def test_offer_price_two_items(): checkout = Checkout() checkout.add_item(item_b) checkout.add_item(item_b) assert checkout.get_total_cost() == 45
def test_offer_price_tree_items(): checkout = Checkout() checkout.add_item(item_a) checkout.add_item(item_a) checkout.add_item(item_a) assert checkout.get_total_cost() == 130
def test_simple_price_two_items(): checkout = Checkout() checkout.add_item(item_a) checkout.add_item(item_b) assert checkout.get_total_cost() == 80
def test_simple_price(): checkout = Checkout() checkout.add_item(item_a) assert checkout.get_total_cost() == 50
def test_simple_no_items(): checkout = Checkout() assert checkout.get_total_cost() == 0