Пример #1
0
        public async Task CanGetHistoryRates()
        {
            var client = new RatesExchangeApiService(ApiKey);
            var result = await client.GetHistoryRates(OtherCurrency, HistoryDateForRates);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Rates, Is.Not.Null);
        }
Пример #2
0
        private static async Task <decimal> GetExchangeRateForDate(string date, string apiKey)
        {
            var client        = new RatesExchangeApiService(apiKey);
            var isoCurrencies = new List <string> {
                "BRL"
            };
            var rates = await client.GetHistoryRates("USD", date, isoCurrencies);

            var rate = rates.Rates["BRL"];

            return(rate);
        }