public void SetUp() { _container = new UnityContainer(); _container.RegisterType <ApiWeatherManager>(); _container.RegisterType <ApiWeatherManager>(); _container.RegisterType <IApiWeatherHttpClientBuilder, ApiWeatherHttpClientBuilder <HttpClientWrapper> >(); _container.RegisterInstance <List <ApiConfiguration> >(WeatherApiConfigurationSection.ToApiConfiguration()); }
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"))); }
public static void RegisterTypesAfterStart(IUnityContainer container) { container.RegisterInstance <List <ApiConfiguration> >(WeatherApiConfigurationSection.ToApiConfiguration()); }