コード例 #1
0
        public void RemoveLines_no_this_type_of_menu_items()
        {
            //Arrange
            var cart = new Cart();
            var testMenuItem = new MenuItem();

            //Act
            cart.RemoveLine(testMenuItem);
        }
コード例 #2
0
 public RedirectToRouteResult RemoveFromCart(Cart cart, int menuItemId, string returnUrl)
 {
     var menuItem = _baseDataAccess.GetMenuItems()
     .FirstOrDefault(m => m.Id == menuItemId);
     if (menuItem != null)
     {
         cart.RemoveLine(menuItem);
     }
     return RedirectToAction("Index", new { returnUrl });
 }