public Price ConvertTo(Currency targetCurrency) { if (targetCurrency == Unit) { return(this); } return(new Price(Amount * ExchangeRates.Get(Unit, targetCurrency), targetCurrency)); }
public void ExchangeRateForDifferentCurrencyIsNotOne() { var x = ExchangeRates.Get(Currency.EUR, Currency.JPY); Assert.IsTrue(x != 1); }
public void ExchangeRateForSameCurrencyIsOne() { var x = ExchangeRates.Get(Currency.EUR, Currency.EUR); Assert.IsTrue(x == 1); }