private static decimal CalculateDiscountAtLevel(int level) { var discount = Bookshop.GetDiscountForLevel(level); var cost = level * Bookshop.Price * (1 - discount); return(cost); }
private static decimal ApplyHighestDiscount(ref Basket basket) { var level = basket.Distinct; var discount = Bookshop.GetDiscountForLevel(level); basket.RemoveDistinctLevel(); var cost = level * Bookshop.Price * (1 - discount); return(cost); }