예제 #1
0
        public void Given_OneUnknownConfiguredCurrencyWithMore_When_GetConfiguredLatestInvoked_Then_ActionResponseWithConfiguredAndBaseExchangeRatesAndErrorsRetrived()
        {
            _serviceUnderTest = ExchangeRateTestHelper.CreateMockService(false);

            var result = _serviceUnderTest.GetConfiguredLatest();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.SelectMany(x => x.Value.ExchangeRates).All(x => x.To == ExchangeRateTestHelper.GetMockedConfiguredCurrencyBase()));
        }
예제 #2
0
        public void Given_ConfiguredCurrencies_When_GetConfiguredLatestInvoked_Then_ActionResponseWithConfiguredAndBaseExchangeRatesRetrived()
        {
            var result = _serviceUnderTest.GetConfiguredLatest();
            var exchangeRatesRetrived = result.SelectMany(x => x.Value.ExchangeRates);

            Assert.IsNotNull(result);
            Assert.IsTrue(exchangeRatesRetrived.All(x => x.To == ExchangeRateTestHelper.GetMockedConfiguredCurrencyBase()));

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