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 void LoadTest() { List <MenuItem> menuItem = MenuItemManager.Load(); int expected = 2; int actual = menuItem.Count; Assert.AreEqual(expected, actual); }
public void InsertTest() { Guid orderId = OrderManager.Load().FirstOrDefault().Id; Guid menuItemId = MenuItemManager.Load().FirstOrDefault().Id; OrderItem orderItem = new OrderItem { Id = Guid.NewGuid(), OrderId = orderId, MenuItemId = menuItemId }; bool result = OrderItemManager.Insert(orderItem); Assert.IsTrue(result); }
// GET: api/MenuItem public IEnumerable <MenuItem> Get() { return(MenuItemManager.Load()); }
private void Reload() { dgvMenu.ItemsSource = null; menuItems = MenuItemManager.Load(); dgvMenu.ItemsSource = menuItems; }