Пример #1
0
        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);
        }
Пример #2
0
        public void LoadTest()
        {
            List <MenuItem> menuItem = MenuItemManager.Load();

            int expected = 2;
            int actual   = menuItem.Count;

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        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);
        }
Пример #4
0
 // GET: api/MenuItem
 public IEnumerable <MenuItem> Get()
 {
     return(MenuItemManager.Load());
 }
Пример #5
0
 private void Reload()
 {
     dgvMenu.ItemsSource = null;
     menuItems           = MenuItemManager.Load();
     dgvMenu.ItemsSource = menuItems;
 }