Beispiel #1
0
 private static void CurrencyCheck(Money left, Money right)
 {
     if (left.Currency != right.Currency)
     {
         throw new ArithmeticException(
             "Unable to perform arithmetic operations on Money values of different Currency.");
     }
 }
Beispiel #2
0
 public bool Equals(Money other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.Amount == Amount && Equals(other.Currency, Currency);
 }