本文整理汇总了C#中Stock.DecreaseStock方法的典型用法代码示例。如果您正苦于以下问题:C# Stock.DecreaseStock方法的具体用法?C# Stock.DecreaseStock怎么用?C# Stock.DecreaseStock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stock
的用法示例。
在下文中一共展示了Stock.DecreaseStock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DecreaseStockCount_By_One_Stock_Is_Empty
public void DecreaseStockCount_By_One_Stock_Is_Empty()
{
// Arrange
Drug drug = new Drug("Ibuprophen");
Fakes.FakeStockProvider stockProvider = new Fakes.FakeStockProvider(0);
Stock stock = new Stock(stockProvider);
// Act
stock.DecreaseStock(drug, 1);
}
示例2: DecreaseStockCount_By_Five_Stock_Is_Too_Low
public void DecreaseStockCount_By_Five_Stock_Is_Too_Low()
{
// Arrange
Drug drug = new Drug("Ibuprophen");
Fakes.FakeStockProvider stockProvider = new Fakes.FakeStockProvider(4);
Stock stock = new Stock(stockProvider);
// Act
stock.DecreaseStock(drug, 5);
}
示例3: DecreaseStockCount_By_One_Stock_Is_Not_Empty
public void DecreaseStockCount_By_One_Stock_Is_Not_Empty()
{
// Arrange
Drug drug = new Drug("Ibuprophen");
Fakes.FakeStockProvider stockProvider = new Fakes.FakeStockProvider(10);
Stock stock = new Stock(stockProvider);
Assert.That(stock.StockCount(drug), Is.EqualTo(10));
// Act
stock.DecreaseStock(drug, 1);
// Assert
Assert.That(stock.StockCount(drug), Is.EqualTo(9));
}