Beispiel #1
0
        public void Given_OneUnknownConfiguredCurrencyWithMoreAndDates_When_GetGetConfiguredHistoricalAsyncInvoked_Then_ActionResponseWithConfiguredAndBaseExchangeRatesRetrived()
        {
            _serviceUnderTest = ExchangeRateTestHelper.CreateMockService(false);
            DateTime beginDate = new DateTime(2018, 1, 1), endDate = new DateTime(2018, 1, 7);

            var result = _serviceUnderTest.GetConfiguredHistoricalAsync(beginDate, endDate).Result;

            Assert.IsNotNull(result);
        }
Beispiel #2
0
        public void Given_ConfiguredCurrenciesAndDates_When_GetGetConfiguredHistoricalAsyncInvoked_Then_ActionResponseWithConfiguredAndBaseExchangeRatesRetrived()
        {
            DateTime beginDate = DateTime.Now.AddMonths(-1), endDate = DateTime.Now.AddMonths(-1).AddDays(7);

            var result                = _serviceUnderTest.GetConfiguredHistoricalAsync(beginDate, endDate).Result;
            var exchangeRatesRetrived = result.SelectMany(x => x.Value.ExchangeRates);

            Assert.IsNotNull(result);
            foreach (var configCurrency in ExchangeRateTestHelper.GetMockedConfiguredCurrencies())
            {
                Assert.IsTrue(exchangeRatesRetrived.Any(x => x.From == configCurrency));
            }
        }