Exemplo n.º 1
0
 public ItemPile(StockKeepingUnit unit, int quantity)
 {
     if (quantity < 0)
     {
         throw new InvalidOperationException();
     }
     Unit     = unit;
     Quantity = quantity;
 }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            StockKeepingUnit other = obj as StockKeepingUnit;

            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            if (!other.Name.Equals(Name, StringComparison.CurrentCultureIgnoreCase))
            {
                return(false);
            }

            if (other.Price != Price)
            {
                return(false);
            }

            return(true);
        }