Пример #1
0
 public SettingsPresenter(ISettingsView view)
 {
     this.view = view;
     try
     {
         xmlService = new XmlService();
         webClientService = new WebClientService();
         openWeatherService = new OpenWeatherService();
         dbContext = new MeteoContext();
         locationRepository = new EfRepository<Location>(dbContext);
         weatherForecastRepository = new EfRepository<WeatherForecast>(dbContext);
         meteoService = new MeteoService(locationRepository, weatherForecastRepository);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Пример #2
0
        public void InitTest()
        {
            xmlServiceMock = new Mock<IXmlService>();
            webClientServiceMock = new Mock<IWebClientService>();
            openWeatherServiceMock = new Mock<IOpenWeatherService>();
            xmlService = new XmlService();
            webClientService = new WebClientService();
            openWeatherService = new OpenWeatherService();

            IDbContext dbContext = new MeteoContext();
            IRepository<Location> locationRepository = new EfRepository<Location>(dbContext);
            IRepository<WeatherForecast> weatherForecastRepository = new EfRepository<WeatherForecast>(dbContext);
            meteoService = new MeteoService(locationRepository, weatherForecastRepository);
        }