示例#1
0
        public void SetUp()
        {
            _container = new UnityContainer();

            _container.RegisterType <ApiWeatherManager>();
            _container.RegisterType <ApiWeatherManager>();
            _container.RegisterType <IApiWeatherHttpClientBuilder, ApiWeatherHttpClientBuilder <HttpClientWrapper> >();
            _container.RegisterInstance <List <ApiConfiguration> >(WeatherApiConfigurationSection.ToApiConfiguration());
        }
示例#2
0
        public void SetUp()
        {
            _container = new UnityContainer();

            _container.RegisterType <ApiWeatherManager>();
            _container.RegisterType <IApiWeatherHttpClientBuilder, ApiWeatherHttpClientBuilder <HttpClientWrapper> >();

            var apis = WeatherApiConfigurationSection.ToApiConfiguration();

            _container.RegisterInstance <ApiConfiguration>("BBCWeather", apis.First(a => a.Name.Contains("BBC")));
            _container.RegisterInstance <ApiConfiguration>("AccuWeather", apis.First(a => a.Name.Contains("Accu")));
        }
示例#3
0
 public static void RegisterTypesAfterStart(IUnityContainer container)
 {
     container.RegisterInstance <List <ApiConfiguration> >(WeatherApiConfigurationSection.ToApiConfiguration());
 }