public void TestDetailsAction()
        {
            var expectedCart = TestHelper.Get2RandomOrders();

            var serviceMock = new Mock<ICartService>();
            serviceMock.Setup(x => x.GetCart()).Returns(expectedCart);

            var controller = new CartController(serviceMock.Object);
            var result = controller.Details() as PartialViewResult;

            Assert.NotNull(result);
            serviceMock.Verify(x => x.GetCart(), Times.Once());
            result.WithNameHasModelType<IList<Order>>("_Cart");
            Assert.Equal(2, expectedCart.Count);
        }
        public void TestDeletection()
        {
            var expectedCart = TestHelper.Get2RandomOrders();
            var cardId = TestHelper.CreateRandomNumber(1, 10);
            var expectedOrder = TestHelper.CreateRandomOrderForCardId(cardId);

            var serviceMock = new Mock<ICartService>();
            serviceMock.Setup(x => x.UnPlace1QuantityOrderAndReturnSummaryOrderForCard(cardId)).Returns(expectedOrder);
            serviceMock.Setup(x => x.GetCart()).Returns(expectedCart);

            var controller = new CartController(serviceMock.Object);
            var actualResult = controller.Delete(new CartInputModel { CardId = cardId }) as PartialViewResult;

            serviceMock.Verify(x => x.UnPlace1QuantityOrderAndReturnSummaryOrderForCard(cardId), Times.Once());
            serviceMock.Verify(x => x.GetCart(), Times.Once());

            actualResult.WithNameHasModel<IList<Order>>("_Cart", expectedCart);

            AssertCartContain(expectedCart, actualResult);
        }