示例#1
0
        public IActionResult Index()
        {
            User loggedInUser = HttpContext.Session.GetUser();

            ViewBag.Cart = cartLogic.GetCartByUser(loggedInUser);
            return(View());
        }
示例#2
0
        public void UnitAddToCart()
        {
            User user = new User()
            {
                Email    = "*****@*****.**",
                Name     = "Testy Test",
                Password = "******",
                IsAdmin  = false,
                Cart     = new List <Product>()
            };
            Product product = new Product()
            {
                Name        = "Nike Shirt",
                Description = "Hele mooie Nike Shirt",
                ImageURL    = "https://i.ya-webdesign.com/images/nike-swoosh-png-white-6.png",
                Price       = 49.99,
            };

            cartLogicTest.AddToCart(product, user);
            Assert.IsTrue(cartLogicTest.GetCartByUser(user).Any());
        }