コード例 #1
0
def order():
    return Order(100)
コード例 #2
0
def test_order_discount_strategy_validate_error():
    order = Order(10, discount_strategy=on_sale_discount)

    assert order.discount_strategy is None
コード例 #3
0
def test_discount_apply_success(func, price, discount):
    order = Order(price, func)

    assert order.apply_discount() == discount
コード例 #4
0
def test_order_discount_strategy_validate_success(func, price):
    order = Order(price, func)

    assert order.price == price
    assert order.discount_strategy == func