Beispiel #1
0
        public void BasketsController_Get_Basket_Order_Lines_Return_Correct_Number()
        {
            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.GetBasketOrderLines(_testBasketId);

            OkObjectResult okresult = actionResult as OkObjectResult;

            Assert.IsNotNull(okresult);

            List <OrderLineDto> resultOrderLines = okresult.Value as List <OrderLineDto>;

            Assert.IsNotNull(resultOrderLines);

            Assert.AreEqual(resultOrderLines.Count, 2);
        }