public void ItemsEngine_UpdateItem() { //Arrange: Seed the Mocked Accessor's list of items and create an updated version of an Item SeedItems(); var expected = new Item() { Id = 2, Name = "Cranberry Juice", }; //Act: Calls the ItemsEngine UpdateItem() method and uses the GetState() method to retrieve the Mocked Accessor's list itemsEngine.UpdateItem(2, expected); List <Item> results = mockedItemsAccessor.GetState(); //Assert: Checks if the Name for the Item was successfully updated Assert.AreEqual(expected.Name, results.ElementAt(2).Name, "The Item wasn't updated correctly."); }
public void PutList(string id, Item item) { var parsedId = int.Parse(id); _itemsEngine.UpdateItem(parsedId, item); }