Basic total generation, no discounts for now

This commit is contained in:
David Underwood
2026-07-15 10:44:00 -04:00
parent 8e28112a8c
commit dadfeed768
3 changed files with 28 additions and 7 deletions
+17 -2
View File
@@ -16,7 +16,22 @@ class TestCheckout < Minitest::Test
def test_that_allowed_items_are_added
@checkout.add(:PI5)
@checkout.add(:ZERO2W)
@checkout.add(:PICO2)
assert_equal [:PI5, :ZERO2W].sort, @checkout.items.sort
assert_equal [:PI5, :ZERO2W, :PICO2].sort, @checkout.items.sort
end
end
def test_that_total_is_the_sum_of_all_items # Not accounting for discounts at the moment
@checkout.add(:PI5) # 60.00
@checkout.add(:ZERO2W) # 15.00
@checkout.add(:PICO2) # 4.00
# -----
# 79.00 total
assert_equal 79.00, @checkout.total
end
def test_that_an_empty_checkout_total_is_zero
assert_equal 0.00, @checkout.total
end
end