public void IgnoresUpcomingDiscountCode()
        {
            const decimal orderTotal = 100.0m;
            var           applier    = new DiscountCodeApplier(UpcomingDiscountCode(10.0m));

            Assert.AreEqual(100.0m, applier.DiscountedTotal(orderTotal));
        }
        public void IgnoresInactiveDiscountCode()
        {
            const decimal orderTotal = 100.0m;
            var           applier    = new DiscountCodeApplier(DiscountCode(10.0m, false));

            Assert.AreEqual(100.0m, applier.DiscountedTotal(orderTotal));
        }
        public void CalculatesDiscountTotalFromPercentage()
        {
            const decimal orderTotal = 150.0m;
            var           applier    = new DiscountCodeApplier(PercentageDiscountCode(20.0m));

            Assert.AreEqual(120.0m, applier.DiscountedTotal(orderTotal));
        }
        public void DiscountedTotalFromPercentageCannotBeLessThanZero()
        {
            const decimal orderTotal = 100.0m;
            var           applier    = new DiscountCodeApplier(PercentageDiscountCode(110.0m));

            Assert.AreEqual(0.0m, applier.DiscountedTotal(orderTotal));
        }
        public void CalculatesDiscountTotal()
        {
            const decimal orderTotal = 100.0m;
            var           applier    = new DiscountCodeApplier(DiscountCode(10.0m));

            Assert.AreEqual(90.0m, applier.DiscountedTotal(orderTotal));
        }