public void GetAnExchangeRate() { MockExchangeRateApi api = new MockExchangeRateApi(); Exchange exchange = new Exchange(api); double rate = exchange.GetRate("GBP", "EUR"); Assert.Equal(1.357, rate); }
public void ExtractTheListOfCurrencyFromJson() { List<string> expected = new List<string>(); expected.Add("USD"); expected.Add("EUR"); MockExchangeRateApi api = new MockExchangeRateApi(); Exchange exchange = new Exchange(api); List<string> currencies = exchange.GetAllCurrencies(); Assert.Equal(expected, currencies); }
public Converter(Exchange exchange) { this.exchange = exchange; }