public void AddToCart_OneProd_RedirectToCartScreen()
        {
            // Arange
            var prodRepoMack   = CreateRepositoryWithOneProduct();
            var cart           = new Cart();
            var cartController = new CartController(prodRepoMack.Object, null);

            // Act
            var actionResult = cartController.AddtoCart(cart, 1, "myUrl");

            // Assert
            Assert.AreEqual("myUrl", actionResult.RouteValues["returnUrl"]);
            Assert.AreEqual("Index", actionResult.RouteValues["action"]);
        }
        public void AddToCart_OneProduct_ProductAdded()
        {
            // Arange
            var prodRepoMock = CreateRepositoryWithOneProduct();

            var cart           = new Cart();
            var cartController = new CartController(prodRepoMock.Object, null);

            // Act
            cartController.AddtoCart(cart, 1, null);

            // Assert
            Assert.AreEqual(cart.CartLines.Count(), 1);
            Assert.AreEqual(cart.CartLines.First().Product.ProductID, 1);
        }