public void DecreaseStock_ThrowsWhenCurrentQuantityIsZero() { var iq = 0; var sp = new StockProduct(p, iq); Assert.Throws <InvalidOperationException>(() => sp.DecreaseStock(10)); }
public void DecreaseStock_ThrowsWhenCurrentQuantityWouldBeNegativeAfterOperation() { var iq = 10; var sp = new StockProduct(p, iq); Assert.Throws <InvalidOperationException>(() => sp.DecreaseStock(11)); }
public void DecreaseStock_ReducesStockByQuantity() { var iq = 11; var sp = new StockProduct(p, iq); sp.DecreaseStock(10); Assert.Equal(1, sp.Quantity); }