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

            var result = _serviceUnderTest.GetBidirectionalAsync(currencyFrom, currencyTo, date).Result;

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count(), 2);
            Assert.IsTrue(result.Any(x => x.From == currencyFrom));
            Assert.IsTrue(result.Any(x => x.From == currencyTo));
            Assert.IsTrue(result.Any(x => x.To == currencyTo));
            Assert.IsTrue(result.Any(x => x.To == currencyFrom));
            Assert.IsTrue(result.All(x => x.Rate > 0));
            Assert.IsTrue(result.All(x => x.Date == date));
        }