public void Given_OneUnknownConfiguredCurrencyWithMore_When_GetConfiguredLatestAsyncInvoked_Then_ActionResponseWithConfiguredAndBaseExchangeRatesAndErrorsRetrived() { _serviceUnderTest = ExchangeRateTestHelper.CreateMockService(false); var result = _serviceUnderTest.GetConfiguredLatestAsync().Result; Assert.IsNotNull(result); Assert.IsTrue(result.SelectMany(x => x.Value.ExchangeRates).All(x => x.To == ExchangeRateTestHelper.GetMockedConfiguredCurrencyBase())); }
public void Given_ConfiguredCurrencies_When_GetConfiguredLatestAsyncInvoked_Then_ActionResponseWithConfiguredAndBaseExchangeRatesRetrived() { var result = _serviceUnderTest.GetConfiguredLatestAsync().Result; 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)); } }