Skip to content

mmuir-accenture/lambda-kata

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lambda

  1. Given a list of Articles, Cart calculates the bill summing all the Prices;
  2. DiscountCart applies a 50% discount to all articles whose Price is greater than 5 CHF;
  3. With FreeDrinkCart all the drinks are for free;
  4. With PromotionCart all the articles whouse Price is smaller than 2 CHF are given for free;
  5. In DiscountCart, the discount and the threshold can be parametrized;
  6. Remove all the duplicated code, applying the Strategy Pattern;
  7. Replace theinterface and the 3 carts with a delegate and 3 methods;
  8. Replace the 3 methods with local functions;
  9. Replace local functions with a local delegate;
  10. Replace the delegate in the cart constructor with a Func;
  11. Simplify the syntax with a Lambda expression.

About

Playing with C# and Lambda expressions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%