示例#1
0
 public void DecreaseStock(Drug drug, int decrease)
 {
     if (stockProvider.StockCount(drug) <= 0)
         throw new StockIsEmptyException();
     if (stockProvider.StockCount(drug) < decrease)
         throw new StockIsTooLowException();
     stockProvider.DecreaseStock(drug, decrease);
 }
 public Prescription(DateTime expiry, IClock clock, Drug drug)
 {
     this.expiry = expiry;
     this.clock = clock;
 }
示例#3
0
 public int StockCount(Drug drug)
 {
     return stockProvider.StockCount(drug);
 }
示例#4
0
 public bool IsDrugInStock(Drug drug)
 {
     return stockProvider.StockCount(drug) > 0;
 }