public void ListAllInventoryItems() { var fakeInventoryRepository = new FakeInventoryRepository(); var fridge = new FridgeService(fakeInventoryRepository); var result = fridge.GetAllInventoryItems(); Assert.AreEqual(0, result.Count); }
public void ListAllInventoryItems() { var invItem1 = "Meatballs"; var invItem2 = "Potato"; var invItem3 = "Pasta"; var fakeInventoryRepository = new FakeInventoryRepository(); var fridge = new FridgeService(fakeInventoryRepository); var inventoryItem = new InventoryItem(invItem1, 10); fridge.AddIngredientToFridge(inventoryItem); inventoryItem = new InventoryItem(invItem2, 50); fridge.AddIngredientToFridge(inventoryItem); inventoryItem = new InventoryItem(invItem3, 4); fridge.AddIngredientToFridge(inventoryItem); var result = fridge.GetAllInventoryItems(); Assert.AreEqual(3, result.Count); Assert.AreEqual(invItem1, result[0].Name); Assert.AreEqual(invItem2, result[1].Name); Assert.AreEqual(invItem3, result[2].Name); }
public List <InventoryItem> Get() { return(_fridgeService.GetAllInventoryItems()); }