public void PutMenuItemTest()
        {
            const string menuItem2Revised = "{\"menuId\": \"2\", \"description\": \"MenuItemTest2 Revised\", \"price\": \"5.49\"}";

            _menuItemsService.PostMenuItem(MenuItem2);
            _menuItemsService.PutMenuItem(2, menuItem2Revised);

            var menuItem = _menuItemsService.GetMenuItem(2);

            Assert.AreEqual(2, menuItem.MenuId);
            Assert.AreEqual("MenuItemTest2 Revised", menuItem.Description);
            Assert.AreEqual(5.49, menuItem.Price);
        }
Beispiel #2
0
        // PUT: api/menuitems/5
        public void Put(int id, [FromBody] dynamic value)
        {
            var menuItem = JsonConvert.SerializeObject(value);

            _menuItemsService.PutMenuItem(id, menuItem);
        }