public async Task <RedirectToActionResult> AddToCart(int productID, string returnUrl)
        {
            Product product = await _repository.SearchAsync(productID);

            if (product != null)
            {
                _cart.AddLineItem(product, 1);
            }
            ViewData["NumberOfCart"] = _cart.LineItems.Count;
            return(RedirectToAction("Index", new { returnUrl }));
        }
Esempio n. 2
0
        public void OrderTour()
        {
            var lineItem = new LineItem(Tour)
            {
                Quantity = 30
            };

            _order.AddLineItem(lineItem);

            Assert.AreEqual(_order.Total, 29565M);
            _order.LineItems.Clear();
        }