private static void RegisterServicesSingleton(IServiceCollection services, InternalConfiguration configurationBase) { services.AddSingleton(configurationBase); services.AddSingleton(StaticDataServiceFactory.GetCityService(configurationBase)); services.AddSingleton(StaticDataServiceFactory.GetCountryService(configurationBase)); services.AddSingleton(StaticDataServiceFactory.GetCurrencyService(configurationBase)); services.AddSingleton(StaticDataServiceFactory.GetExchangeRateService(configurationBase)); }
public void Given_Configuration_When_GetExchangeRateServiceInvoked_Then_IExchangeRateServiceRetrived() { var configuration = new InternalConfiguration(StaticDataConfigurationBuilder.Generate()); var service = StaticDataServiceFactory.GetExchangeRateService(configuration); Assert.IsNotNull(service); Assert.AreEqual(typeof(ExchangeRateService), service.GetType()); }