Exemple #1
0
        public void BasketsController_Get_Single_Basket_Return_Correct_Basket()
        {
            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.GetBasketById(_testBasketId);

            OkObjectResult okresult = actionResult as OkObjectResult;

            Assert.IsNotNull(okresult);

            BasketDto resultBasket = okresult.Value as BasketDto;

            Assert.IsNotNull(resultBasket);

            Assert.AreEqual(resultBasket.Id, _testBasketId);
        }