public void DeleteTest() { List <MenuItem> menuItems = MenuItemManager.Load(); MenuItem menuItem = menuItems.Where(c => c.ItemName == "Cheesy Garlic Bread").FirstOrDefault(); int actual = MenuItemManager.Delete(menuItem.Id); Assert.IsTrue(actual > 0); }
public JsonResult DeleteItem(int ItemId) { var _menuItemManager = new MenuItemManager(); var item = _menuItemManager.GetById(ItemId); if (item.ItemId > 0) { _menuItemManager.Delete(ItemId); return(Json(true)); } else { return(Json(false)); } }
// DELETE: api/MenuItem/5 public void Delete(Guid id) { MenuItemManager.Delete(id); }
public void Delete() { bool result = MenuItemManager.Delete(2); Assert.IsTrue(result); }