Exemplo n.º 1
0
        public void PromotionWithNoCartsTests()
        {
            IPromotionServices _promotionServices = new FixedPricePromotionServices(new List <string> {
                "C", "D"
            }, 30);

            Assert.Equal(0, _promotionServices.Price());
        }
Exemplo n.º 2
0
        public void PromotionWithValidSkuItemsTests()
        {
            IPromotionServices _promotionServices = new FixedPricePromotionServices(new List <string> {
                "C", "D"
            }, 30);

            _promotionServices.SetCart(_cartService);
            _promotionServices.SetPriceList(_priceListService);
            Assert.Equal(305, _promotionServices.Price());
        }
Exemplo n.º 3
0
        public void PromotionWithInvalidItemsTests()
        {
            IPromotionServices _promotionServices = new FixedPricePromotionServices(new List <string> {
                "C", "D"
            }, 30);

            _cartService.RemoveItem("C");
            _promotionServices.SetCart(_cartService);
            _promotionServices.SetPriceList(_priceListService);
            Assert.Equal(_cartService.Price(), _promotionServices.Price());
        }