- Given a list of Articles,
Cartcalculates the bill summing all thePrices; DiscountCartapplies a 50% discount to all articles whosePriceis greater than 5 CHF;- With
FreeDrinkCartall the drinks are for free; - With
PromotionCartall the articles whousePriceis smaller than 2 CHF are given for free; - In
DiscountCart, the discount and the threshold can be parametrized; - Remove all the duplicated code, applying the Strategy Pattern;
- Replace theinterface and the 3 carts with a delegate and 3 methods;
- Replace the 3 methods with local functions;
- Replace local functions with a local delegate;
- Replace the
delegatein the cart constructor with aFunc; - Simplify the syntax with a Lambda expression.
forked from TicinoXP/lambda-kata
-
Notifications
You must be signed in to change notification settings - Fork 0
mmuir-accenture/lambda-kata
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
Playing with C# and Lambda expressions
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- C# 100.0%