Esempio n. 1
0
        public void CartItem_Price_ShouldBeTheResultOfGetPrice()
        {
            A.CallTo(() => _productVariant.GetPrice(2)).Returns(20);
            var cartItem = new CartItem {
                Item = _productVariant, Quantity = 2
            };

            var price = cartItem.Price;

            price.Should().Be(20);
        }
Esempio n. 2
0
        public void ProductVariant_GetPrice_ShouldGetHighestQuantityMatchingPriceBreak()
        {
            Kernel.SetTaxSettings(true, true);
            var variant = new ProductVariant
            {
                BasePrice   = 10,
                PriceBreaks = new List <PriceBreak>
                {
                    new PriceBreak {
                        Quantity = 2, Price = 9
                    },
                    new PriceBreak {
                        Quantity = 3, Price = 8
                    },
                    new PriceBreak {
                        Quantity = 4, Price = 7
                    }
                }
            };

            variant.GetPrice(3).Should().Be(24);
        }