public void CheckMax() { IDiscountCalculator discountCalculator1 = new DiscountCalculator(new Func <ShoppingBasket, DiscountOfProducts>((ShoppingBasket shoppingBasket) => d1)); IDiscountCalculator discountCalculator2 = new DiscountCalculator(new Func <ShoppingBasket, DiscountOfProducts>((ShoppingBasket shoppingBasket) => d2)); IDiscountCalculator discountCalculator3 = discountCalculator1.Max(discountCalculator2); Assert.AreEqual(20, discountCalculator3.CalcDiscount(shoppingBasket).Discount); }
public virtual DiscountOfProducts CalcDiscount(ShoppingBasket shoppingBasket) { return(discountCalculator.CalcDiscount(shoppingBasket)); }