public void FromEmptyFridgeRemoveInventoryItem() { FridgeWorker currentFridge = new FridgeWorker(); Double result = currentFridge.TakeItemFromFridge(inventoryItemMeatballs, 5); Assert.AreEqual(-5, result); }
public void IsItemAvailable() { MockFridgeRepository mockRepo = new MockFridgeRepository(); FridgeWorker fridgeWorker = new FridgeWorker(mockRepo); Assert.AreEqual(false, fridgeWorker.IsItemAvailable(inventoryItemMeatballs, 7)); }
public void FromFullFridgeIsItemAvailable() { FridgeWorker currentFridge = new FridgeWorker(); currentFridge.AddIngredientToFridge(new FridgeInventory(inventoryItemMeatballs, 10)); Assert.AreEqual(true, currentFridge.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 DoesInventoryItemExist() { FridgeWorker currentFridge = new FridgeWorker(); currentFridge.AddIngredientToFridge(new FridgeInventory(inventoryItemMeatballs, 10)); FridgeInventory result = currentFridge.GetInventoryItem(inventoryItemMeatballs); Assert.AreEqual(10, result.Quantity); }
public void ToEmptyFridgeAddTwoIdenticalInventoryItem() { FridgeWorker currentFridge = new FridgeWorker(); currentFridge.AddIngredientToFridge(new FridgeInventory(inventoryItemMeatballs, 10)); currentFridge.AddIngredientToFridge(new FridgeInventory(inventoryItemMeatballs, 10)); // Assert.AreEqual( 1, currentFridge.InventoryList.Count); // Assert.AreEqual(20, currentFridge.InventoryList[0].Quantity); }
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 FromFullFridgeRemoveNonExistingInventoryItem() { string invItem1 = "Meatballs"; string invItem2 = "Potato"; string invItem3 = "Pasta"; string invRemoveItem = "Sauce"; FridgeWorker currentFridge = new FridgeWorker(); currentFridge.AddIngredientToFridge(new FridgeInventory(invItem1, 10)); currentFridge.AddIngredientToFridge(new FridgeInventory(invItem2, 50)); currentFridge.AddIngredientToFridge(new FridgeInventory(invItem3, 4)); Double result = currentFridge.TakeItemFromFridge(invRemoveItem, 5); Assert.AreEqual(-5, result); }
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); }
public FridgeController() { _fridgeWorker = new FridgeWorker(); }
public void FromEmptyFridgeIsItemAvailable() { FridgeWorker currentFridge = new FridgeWorker(); Assert.AreEqual(false, currentFridge.IsItemAvailable(inventoryItemMeatballs, 7)); }
public void ToEmptyFridgeAddOneInventoryItem() { FridgeWorker currentFridge = new FridgeWorker(); currentFridge.AddIngredientToFridge(new FridgeInventory(inventoryItemMeatballs, 10)); }