コード例 #1
0
 private void ValidateEvent(InventoryEvent inventoryEvent)
 {
     if (Stock + inventoryEvent.Quantity < 0)
     {
         throw new ArgumentException("Cannot withdraw below stock of " + Stock);
     }
 }
コード例 #2
0
 private void ValidateEvent(InventoryEvent inventoryEvent)
 {
     if (Stock + inventoryEvent.Quantity < 0)
     {
         throw new ArgumentException("Cannot withdraw below stock of " + Stock);
     }
 }
コード例 #3
0
        internal void Apply(InventoryEvent inventoryEvent)
        {
            ValidateEvent(inventoryEvent);

            Stock += inventoryEvent.Quantity;
            Events.Add(inventoryEvent);
        }
コード例 #4
0
        internal void Apply(InventoryEvent inventoryEvent)
        {
            ValidateEvent(inventoryEvent);

            Stock += inventoryEvent.Quantity;
            Events.Add(inventoryEvent);
        }