11import approvaltests
22import pytest
33
4- from src .model_objects import SpecialOfferType
4+ from src .model_objects import SpecialOfferType , Product
55from tests .receipt_printer import ReceiptPrinter
66
7+ from src .teller import Teller
8+ from src .shopping_cart import ShoppingCart
79
8- def test_empty_basket (teller , cart , toothbrush , apples ):
10+
11+ def test_empty_basket (teller : Teller , cart : ShoppingCart , toothbrush : Product , apples : Product ) -> None :
912 receipt = teller .checks_out_articles_from (cart )
1013
1114 approvaltests .verify (ReceiptPrinter ().print_receipt (receipt ))
1215
13- def test_no_discount (teller , cart , toothbrush , apples ):
16+
17+ def test_no_discount (teller : Teller , cart : ShoppingCart , toothbrush : Product , apples : Product ) -> None :
1418 teller .add_special_offer (SpecialOfferType .TEN_PERCENT_DISCOUNT , toothbrush , 10.0 )
1519 cart .add_item_quantity (apples , 2.5 )
1620
@@ -19,7 +23,7 @@ def test_no_discount(teller, cart, toothbrush, apples):
1923 approvaltests .verify (ReceiptPrinter ().print_receipt (receipt ))
2024
2125
22- def test_ten_percent_discount (teller , cart , toothbrush ) :
26+ def test_ten_percent_discount (teller : Teller , cart : ShoppingCart , toothbrush : Product ) -> None :
2327 teller .add_special_offer (SpecialOfferType .TEN_PERCENT_DISCOUNT , toothbrush , 10.0 )
2428 cart .add_item_quantity (toothbrush , 2 )
2529
@@ -28,15 +32,16 @@ def test_ten_percent_discount(teller, cart, toothbrush):
2832 approvaltests .verify (ReceiptPrinter ().print_receipt (receipt ))
2933
3034
31- def test_three_for_two_discount (teller , cart , toothbrush ) :
35+ def test_three_for_two_discount (teller : Teller , cart : ShoppingCart , toothbrush : Product ) -> None :
3236 teller .add_special_offer (SpecialOfferType .THREE_FOR_TWO , toothbrush , 10.0 )
3337 cart .add_item_quantity (toothbrush , 3 )
3438
3539 receipt = teller .checks_out_articles_from (cart )
3640
3741 approvaltests .verify (ReceiptPrinter ().print_receipt (receipt ))
3842
39- def test_three_for_two_discount_too_few (teller , cart , toothbrush ):
43+
44+ def test_three_for_two_discount_too_few (teller : Teller , cart : ShoppingCart , toothbrush : Product ) -> None :
4045 teller .add_special_offer (SpecialOfferType .THREE_FOR_TWO , toothbrush , 10.0 )
4146 cart .add_item_quantity (toothbrush , 2 )
4247
@@ -45,31 +50,34 @@ def test_three_for_two_discount_too_few(teller, cart, toothbrush):
4550 approvaltests .verify (ReceiptPrinter ().print_receipt (receipt ))
4651
4752
48- def test_five_for_amount_discount (teller , cart , toothbrush ) :
53+ def test_five_for_amount_discount (teller : Teller , cart : ShoppingCart , toothbrush : Product ) -> None :
4954 teller .add_special_offer (SpecialOfferType .FIVE_FOR_AMOUNT , toothbrush , 4.0 )
5055 cart .add_item_quantity (toothbrush , 5 )
5156
5257 receipt = teller .checks_out_articles_from (cart )
5358
5459 approvaltests .verify (ReceiptPrinter ().print_receipt (receipt ))
5560
56- def test_five_for_amount_discount_bought_too_few (teller , cart , toothbrush ):
61+
62+ def test_five_for_amount_discount_bought_too_few (teller : Teller , cart : ShoppingCart , toothbrush : Product ) -> None :
5763 teller .add_special_offer (SpecialOfferType .FIVE_FOR_AMOUNT , toothbrush , 4.0 )
5864 cart .add_item_quantity (toothbrush , 4 )
5965
6066 receipt = teller .checks_out_articles_from (cart )
6167
6268 approvaltests .verify (ReceiptPrinter ().print_receipt (receipt ))
6369
64- def test_two_for_amount_discount (teller , cart , toothbrush ):
70+
71+ def test_two_for_amount_discount (teller : Teller , cart : ShoppingCart , toothbrush : Product ) -> None :
6572 teller .add_special_offer (SpecialOfferType .TWO_FOR_AMOUNT , toothbrush , 1.80 )
6673 cart .add_item_quantity (toothbrush , 5 )
6774
6875 receipt = teller .checks_out_articles_from (cart )
6976
7077 approvaltests .verify (ReceiptPrinter ().print_receipt (receipt ))
7178
72- def test_two_for_amount_discount_bought_too_few (teller , cart , toothbrush ):
79+
80+ def test_two_for_amount_discount_bought_too_few (teller : Teller , cart : ShoppingCart , toothbrush : Product ):
7381 teller .add_special_offer (SpecialOfferType .TWO_FOR_AMOUNT , toothbrush , 1.80 )
7482 cart .add_item_quantity (toothbrush , 1 )
7583
0 commit comments