public void ShouldDiscountMaxRateWithIgnoringActualCalculatedDiscount()
        {
            long price = 3000;

            percentageLimitDiscountStratigy = new PercentageLimitDiscountStrategy(price);

            long discount = percentageLimitDiscountStratigy.Discount();

            Assert.Equal(300, discount);
        }
        public void ShouldDiscountPercentageLimitPolicy()
        {
            long price = 1800;

            percentageLimitDiscountStratigy = new PercentageLimitDiscountStrategy(price);

            long discount = percentageLimitDiscountStratigy.Discount();

            Assert.Equal(270, discount);
        }
        public IDiscountStrategy CreateDiscountStratigy(int couponCode, long productPrice)
        {
            IDiscountStrategy stratigy;

            switch (couponCode)
            {
            case (int)CouponCodes.FlatRateCode:
                stratigy = new FlatRateDiscountStratigy(productPrice);
                break;

            case (int)CouponCodes.PercentageCode:
                stratigy = new PercentageDiscountStrategy(productPrice);
                break;

            case (int)CouponCodes.PercentageLimitCode:
                stratigy = new PercentageLimitDiscountStrategy(productPrice);
                break;

            default:
                throw new ApplicationException($"Sorry! {couponCode} is not a valid Coupon code.");
            }

            return(stratigy);
        }