/// <summary> /// Asserts the currencies. /// </summary> /// <param name="a1">The amount1.</param> /// <param name="a2">The amount2.</param> /// <param name="operationName">The operationName.</param> /// <exception cref="System.ArgumentException"></exception> private static void AssertCurrencies(Amount a1, Amount a2, string operationName, string operationSign) { if (string.Compare(a1.CurrencyID, a2.CurrencyID, StringComparison.OrdinalIgnoreCase) != 0) { throw new ArgumentException(string.Format("Cannot {0} amounts in different currencies: {1} {2} {3}.", operationName, a1, operationSign, a2)); } }
/// <summary> /// Equalses the specified other. /// </summary> /// <param name="other">The other.</param> /// <returns>The result.</returns> protected bool Equals(Amount other) { return string.Equals(this.currencyId, other.currencyId, StringComparison.InvariantCultureIgnoreCase) && this.value == other.value; }