public void OutOfStock(int productId) { products.Where(product => product.Id == productId).First().Stock = 0; var system = new VendingSystem(products, bankedCoins); system.PurchaseProduct(productId); Assert.Equal("SOLD OUT", system.Display); }
public void PurchaseProduct(int productId) { var system = new VendingSystem(products, bankedCoins); system.TotalValue = 1.00m; system.PurchaseProduct(productId); Assert.Equal("THANK YOU", system.Display); }
public void NotEnoughMoneyToPurchase(int productId, decimal initialMoney, string expectedDisplay) { var system = new VendingSystem(products, bankedCoins); system.TotalValue = initialMoney; system.PurchaseProduct(productId); Assert.Equal(expectedDisplay, system.Display); }