Example #1
0
        public void Given_CurrenciesAndDate_When_GetInvoked_Then_ExchangeRateRetrived()
        {
            string currencyFrom = "USD", currencyTo = "EUR";
            var    date = DateTime.Today;

            var data = _serviceUnderTest.GetAsync(currencyFrom, currencyTo, date).Result;

            Assert.IsNotNull(data);
            Assert.AreEqual(currencyFrom, data.From);
            Assert.AreEqual(currencyTo, data.To);
            Assert.AreNotEqual(data.Rate, 0);
            Assert.AreEqual(date, data.Date);
        }
 public Task <ExchangeRate> GetAsync(string currencyFrom, string currencyTo, DateTime?date = null)
 {
     return(_exchangeRateSingleRepository.GetAsync(currencyFrom, currencyTo, date));
 }