Beispiel #1
0
def test_cart_combo1():
    my_cart = Cart()
    my_cart.add_item("CH1")
    my_cart.add_item("AP1")
    my_cart.add_item("CF1")
    my_cart.add_item("MK1")
    my_cart.print_receipt()
    assert my_cart.total == 20.34
Beispiel #2
0
def test_cart_combo3():
    my_cart = Cart()
    my_cart.add_item("AP1")
    my_cart.add_item("AP1")
    my_cart.add_item("CH1")
    my_cart.add_item("AP1")
    my_cart.print_receipt()
    assert my_cart.total == 16.61
Beispiel #3
0
def test_APOM():
    my_cart = Cart()
    my_cart.add_item("OM1")
    my_cart.print_receipt()
    assert my_cart.total == 3.69
    my_cart.add_item("AP1")
    my_cart.print_receipt()
    assert my_cart.total == 6.69
    my_cart.add_item("AP1")
    my_cart.print_receipt()
    assert my_cart.total == 12.69
    my_cart.add_item("OM1")
    my_cart.print_receipt()
    assert my_cart.total == 13.38
Beispiel #4
0
def test_APPL():
    my_cart = Cart()
    my_cart.add_item("AP1")
    my_cart.print_receipt()
    assert my_cart.total == 6.00
    my_cart.add_item("AP1")
    my_cart.print_receipt()
    assert my_cart.total == 12.00
    my_cart.add_item("AP1")
    my_cart.print_receipt()
    assert my_cart.total == 13.5
    my_cart.add_item("AP1")
    my_cart.print_receipt()
    assert my_cart.total == 18.00
Beispiel #5
0
def test_CHMK():
    my_cart = Cart()
    my_cart.add_item("MK1")
    my_cart.print_receipt()
    assert my_cart.total == 4.75
    my_cart.add_item("CH1")
    my_cart.print_receipt()
    assert my_cart.total == 3.11
    my_cart.add_item("CH1")
    my_cart.print_receipt()
    assert my_cart.total == 6.22
    my_cart.add_item("MK1")
    my_cart.print_receipt()
    assert my_cart.total == 10.97
Beispiel #6
0
def test_BOGO():
    my_cart = Cart()
    my_cart.add_item("CF1")
    my_cart.print_receipt()
    assert my_cart.total == 11.23
    assert my_cart.num_coffee == 1
    my_cart.add_item("CF1")
    my_cart.print_receipt()
    assert my_cart.total == 11.23
    assert my_cart.num_coffee == 2
    my_cart.add_item("CF1")
    my_cart.print_receipt()
    assert my_cart.total == 22.46
    assert my_cart.num_coffee == 3
Beispiel #7
0
def test_cart_combo2():
    my_cart = Cart()
    my_cart.add_item("MK1")
    my_cart.add_item("AP1")
    my_cart.print_receipt()
    assert my_cart.total == 10.75