Ejemplo n.º 1
0
        private static decimal CalculateDiscountAtLevel(int level)
        {
            var discount = Bookshop.GetDiscountForLevel(level);
            var cost     = level * Bookshop.Price * (1 - discount);

            return(cost);
        }
Ejemplo n.º 2
0
        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);
        }