public WeatherProvider( ILogger <WeatherProvider> logger, ILocationProvider locationProvider, ICacheRepository <WeatherConditions> cacheRepository, IForecastService forecastService, IOpenWeatherMapService openWeatherMapService, IYahooWeatherService yahooWeatherService) : base(logger, cacheRepository) { try { var location = locationProvider.Execute().Result; if (location == null) { _logger.LogError($"{GetType().Name}: Cannot get Location. Weather will disabled."); } else { _serializedLocation = JsonConvert.SerializeObject(location); _operations.Add(yahooWeatherService); _operations.Add(openWeatherMapService); _operations.Add(forecastService); } } catch (Exception e) { _logger.LogError("WeatherProvider", e); throw e; } }
public YahooController( ILogger <YahooWeatherService> logger, IYahooWeatherService service, ICookiesService <OauthToken> cookiesService, IAccessTokensRepository accessTokensRepository) : base(logger, service, cookiesService, accessTokensRepository) { _cookieKey = "YahooRequestToken"; }
public YahooWeatherManagerFacts() { _module = new TestModule(); var kernel = new StandardKernel(_module); _weatherService = kernel.Get <IYahooWeatherService>(); _module.YahooHttpManagerMock.Setup(ctx => ctx.Get(It.IsAny <string>())).Returns(new WeatherResponse()); }
public TelegramService(ILog logger, IUpdateManager updateManager, IMessageService messageService, IYahooWeatherService weatherService, IUnitsConverterFactory unitsConverterFactory) { _updateManager = updateManager; _messageService = messageService; _weatherService = weatherService; _unitsConverterFactory = unitsConverterFactory; _logger = logger; _logger.Debug($"Telegram Manager creation..."); _updates = new Queue <Update>(); }