Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public void Given_Configuration_When_GetCurrencyServiceInvoked_Then_ICurrencyServiceRetrived()
        {
            var configuration = new InternalConfiguration(StaticDataConfigurationBuilder.Generate());

            var service = StaticDataServiceFactory.GetCurrencyService(configuration);

            Assert.IsNotNull(service);
            Assert.AreEqual(typeof(CurrencyService), service.GetType());
        }