コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
def test_offer_price_two_items():
    checkout = Checkout()
    checkout.add_item(item_b)
    checkout.add_item(item_b)
    assert checkout.get_total_cost() == 45
コード例 #5
0
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
コード例 #6
0
def test_simple_price_two_items():
    checkout = Checkout()
    checkout.add_item(item_a)
    checkout.add_item(item_b)
    assert checkout.get_total_cost() == 80
コード例 #7
0
def test_simple_price():
    checkout = Checkout()
    checkout.add_item(item_a)
    assert checkout.get_total_cost() == 50
コード例 #8
0
def test_simple_no_items():
    checkout = Checkout()
    assert checkout.get_total_cost() == 0