Exemplo n.º 1
0
        public bool Equals(CashEntry other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Denomination.Equals(other.Denomination));
        }
Exemplo n.º 2
0
 public override int GetHashCode() => Denomination != null?Denomination.GetHashCode() : 0;
Exemplo n.º 3
0
 public CashEntry(Denomination denomination, int quantity)
 {
     Denomination = denomination ?? throw new ArgumentNullException($"{nameof(denomination)} cannot be null");
     Quantity     = quantity >= 0 ? quantity : throw new ArgumentException($"{nameof(quantity)} cannot be less than zero");
 }