Esempio n. 1
0
        public void PriceForQuantity_OnEligibleQuantityAndFractionalDiscount_ShouldReturnRoundedDiscountPricing()
        {
            var decorator            = new SalePercent(_testItem, 1, 33);
            var expectedPriceInCents = 300 - 99; //pasta 3.00 with 33% off

            Assert.AreEqual(expectedPriceInCents, decorator.GetEffectivePrice(1));
        }
Esempio n. 2
0
        public void PriceForQuantity_OnNonEligibleQuantity_ShouldReturnActualPricing()
        {
            var decorator            = new SalePercent(_testItem, 2, 10);
            var expectedPriceInCents = 300; //actual price of pasta 3.00

            Assert.AreEqual(expectedPriceInCents, decorator.GetEffectivePrice(1));
        }
Esempio n. 3
0
        public void PriceForQuantity_OnEligibleQuantity_ShouldReturnDiscountedPricing()
        {
            var decorator            = new SalePercent(_testItem, 1, 10);
            var expectedPriceInCents = 300 - 30; //pasta 3.00 with 10% off

            Assert.AreEqual(expectedPriceInCents, decorator.GetEffectivePrice(1));
        }