public void IsItemAvailable() { MockFridgeRepository mockRepo = new MockFridgeRepository(); FridgeWorker fridgeWorker = new FridgeWorker(mockRepo); Assert.AreEqual(false, fridgeWorker.IsItemAvailable(inventoryItemMeatballs, 7)); }
public void IsExistingItemAvailable() { MockFridgeRepository mockRepo = new MockFridgeRepository(); FridgeWorker fridgeWorker = new FridgeWorker(mockRepo); fridgeWorker.AddIngredientToFridge(new InventoryItem(inventoryItemMeatballs, 10)); Assert.AreEqual(true, fridgeWorker.IsItemAvailable(inventoryItemMeatballs, 7)); }
public void RemoveInventoryItem() { MockFridgeRepository mockRepo = new MockFridgeRepository(); FridgeWorker fridgeWorker = new FridgeWorker(mockRepo); Double result = fridgeWorker.TakeItemFromFridge(new FridgeInventoryItemContract(inventoryItemMeatballs, 5)); Assert.AreEqual(-5, result); }
public void GetItem() { MockFridgeRepository mockRepo = new MockFridgeRepository(); FridgeWorker fridgeWorker = new FridgeWorker(mockRepo); var result = fridgeWorker.GetInventoryItem("Hundgodis"); Assert.AreEqual(null, result); }
public void AddOneInventoryItem() { MockFridgeRepository mockRepo = new MockFridgeRepository(); FridgeWorker fridgeWorker = new FridgeWorker(mockRepo); fridgeWorker.AddIngredientToFridge(new InventoryItem(inventoryItemMeatballs, 10)); Assert.AreEqual(1, mockRepo.InventoryItems.Count); Assert.AreEqual(inventoryItemMeatballs, mockRepo.InventoryItems[0].Name); Assert.AreEqual(10, mockRepo.InventoryItems[0].Quantity); }
public void GetExistingInventoryItem() { MockFridgeRepository mockRepo = new MockFridgeRepository(); FridgeWorker fridgeWorker = new FridgeWorker(mockRepo); fridgeWorker.AddIngredientToFridge(new InventoryItem(inventoryItemMeatballs, 10)); FridgeInventoryItemContract result = fridgeWorker.GetInventoryItem(inventoryItemMeatballs); Assert.AreEqual(10, result.Quantity); }
public void RemoveNonExistingInventoryItem() { string invItem1 = "Meatballs"; string invItem2 = "Potato"; string invItem3 = "Pasta"; string invRemoveItem = "Sauce"; MockFridgeRepository mockRepo = new MockFridgeRepository(); FridgeWorker fridgeWorker = new FridgeWorker(mockRepo); fridgeWorker.AddIngredientToFridge(new InventoryItem(invItem1, 10)); fridgeWorker.AddIngredientToFridge(new InventoryItem(invItem2, 50)); fridgeWorker.AddIngredientToFridge(new InventoryItem(invItem3, 4)); Double result = fridgeWorker.TakeItemFromFridge(new FridgeInventoryItemContract(invRemoveItem, 5)); Assert.AreEqual(-5, result); }