Exemple #1
0
        public void Decrease(StockQuantity amount)
        {
            if (Quantity - amount < 0)
            {
                throw new InsufficientStockException();
            }

            Quantity -= amount;
        }
Exemple #2
0
 protected bool Equals(StockQuantity other)
 {
     return(value == other.value);
 }
Exemple #3
0
 public Stock(ProductId productId, StockQuantity quantity)
 {
     ProductId = productId;
     Quantity  = quantity;
 }