Пример #1
0
        public void BasketsController_Clear_Basket_Check_Basket_Clear()
        {
            var baskets  = new InMemoryDataStore <Basket>();
            var products = new InMemoryDataStore <Product>();

            products.Seed();
            baskets.Seed(products);

            var bc = new BasketsController(products, baskets, _mapper);

            var actionResult = bc.PutClearBasket(_testBasketId);

            OkObjectResult okresult = actionResult as OkObjectResult;

            Assert.IsNotNull(okresult);

            BasketDto basket = okresult.Value as BasketDto;

            Assert.IsNotNull(basket);

            Assert.IsTrue(basket.NumberOfOrderLines == 0);
        }