BOGOF discount for ZERO2W
This commit is contained in:
@@ -34,4 +34,22 @@ class TestCheckout < Minitest::Test
|
||||
def test_that_an_empty_checkout_total_is_zero
|
||||
assert_equal 0.00, @checkout.total
|
||||
end
|
||||
|
||||
# Discounts
|
||||
|
||||
def test_that_bogof_applied
|
||||
4.times do
|
||||
@checkout.add(:ZERO2W)
|
||||
end
|
||||
|
||||
assert_equal 30.00, @checkout.total
|
||||
end
|
||||
|
||||
def test_that_bogof_applied_with_odd_number
|
||||
5.times do
|
||||
@checkout.add(:ZERO2W)
|
||||
end
|
||||
|
||||
assert_equal 45.00, @checkout.total
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user