public WeatherService( IWeatherClient weatherClient, IClientConfiguration configuration) { _weatherClient = weatherClient; _configuration = configuration; }
public FrontEndLogic(IWeatherClient weatherClient, ICityDataAccess cityDataAccess, IConsoleWrapper consoleWrapper, int?loops = null) { _weatherClient = weatherClient; _cityDataAccess = cityDataAccess; _consoleWrapper = consoleWrapper; _loops = loops; // Avoid infinite loop for testing purposes. Yuck! }
public void Remove(IWeatherClient client) { if (registeredClients.Contains<IWeatherClient>(client)) { registeredClients.Remove(client); } }
public void Register(IWeatherClient client) { if (!registeredClients.Contains <IWeatherClient>(client)) { registeredClients.Add(client); } }
public void Remove(IWeatherClient client) { if (registeredClients.Contains <IWeatherClient>(client)) { registeredClients.Remove(client); } }
public HomeController(ILogger <HomeController> logger, IConfiguration configuration, IWeatherClient weatherClient, IWeatherData weatherData) { _logger = logger; _configuration = configuration; _weatherClient = weatherClient; _weatherData = weatherData; }
public WeatherNowController(IWeatherClient <string> weatherClient, ILogger <WeatherNowController> logger, IConfiguration config, IOptions <OpenWeatherMapSettings> openWeatherSettingsAccessor, IMapper mapper) { _weatherClient = weatherClient; _logger = logger; _configuration = config; _openWeatherSettings = openWeatherSettingsAccessor.Value; _mapper = mapper; }
public void Init() { _weatherClient = Substitute.For <IWeatherClient>(); _cityDataAccess = Substitute.For <ICityDataAccess>(); _consoleWrapper = Substitute.For <IConsoleWrapper>(); _weatherClient.CitySearch(Arg.Any <string>()).Returns(new List <SearchCityDto>()); _weatherClient.GetWeather(Arg.Any <string>()).Returns(new CurrentWeatherDto()); _cityDataAccess.GetAllCities().Returns(new List <SearchCityDto>()); _consoleWrapper.WriteLine(Arg.Any <string>()); _consoleWrapper.ReadLine().Returns(string.Empty); _sut = new FrontEndLogic(_weatherClient, _cityDataAccess, _consoleWrapper, 1); }
public WeatherController(IWeatherClient weatherClient) => _weatherClient = weatherClient;
public WeatherController(IWeatherClient weatherClient, IMapper mapper) { _weatherClient = weatherClient; _mapper = mapper; }
public WeatherClient(string url) { _internalClient = RestService.For <IWeatherClient>(url); }
public void Register(IWeatherClient client) { if(!registeredClients.Contains<IWeatherClient>(client)) registeredClients.Add(client); }
public CachingDecorator(IWeatherClient client, IMemoryCache cache) { DecoratedWeatherClient = client; WeatherResultsCache = cache; }
public WeatherController(ILogger <WeatherController> logger, IWeatherClient weaterClient) { this.logger = logger; wClient = weaterClient; }
public WeatherService(IWeatherClient singleClient) { _singleClient = singleClient; }
public WeatherCommands(IWeatherClient weatherClient, IHttpContextAccessor httpContextAccessor) { _weatherClient = weatherClient; _httpContextAccessor = httpContextAccessor; }
public HomeController(IWeatherClient weatherClient) { WeatherClient = weatherClient; }
public DashboardHandler(IStorageService storageService, IWeatherClient weatherClient, IStockClient stockClient) { this.storageService = storageService; this.weatherClient = weatherClient; this.stockClient = stockClient; }
public ApixuWeatherServiceAdapter(IWeatherClient client) { _client = client; }
/// <summary> /// Creates the weather client cache decorator object. You pass in the the /// IWeatherClient object to be decorated (ie wrapped) /// </summary> /// <param name="weatherClient">Am IWeatherClient object of the object to be decorated</param> public WeatherClientCacheDecorator(IWeatherClient weatherClient) { this.wrappedWeatherClient = weatherClient; }
/// <summary> /// Forecast /// </summary> /// <param name="weatherClient"></param> public ForecastController(IWeatherClient weatherClient) { _weatherClient = weatherClient; }
public WeatherController(IWeatherClient weatherClient) { this.weatherClient = weatherClient; }
/// <summary> /// Initialize new instance /// </summary> /// <param name="client">Http client</param> public WeatherRepository(IWeatherClient client) { _client = client ?? throw new ArgumentNullException(nameof(client)); }
public WeatherController(ILogger <WeatherController> logger, IWeatherClient weatherClient, IStationRepository stationRepository) { _logger = logger; _weatherClient = weatherClient; _stationRepository = stationRepository; }
//private readonly IMapper _mapper; public ForecastController(IWeatherClient weatherClient, IConfiguration config)//, IMapper mapper) { _weatherClient = weatherClient; _config = config; //_mapper = mapper; }
public WeatherModule(IWeatherCommandParser parser, IWeatherClient client) { Post["/weather", true] = async (_, token) => { var request = this.Bind<SlackRequest>(); try { Command c = null; if (parser.TryParse(request, out c)) { var postalCode = c.Arguments.First(); var units = c.Arguments.Count() == 2 ? (Units) Enum.Parse(typeof (Units), c.Arguments.ElementAt(1), true) : Units.Imperial; var responseType = c.Arguments.Any(arg => arg.Equals(ShareArgument, StringComparison.OrdinalIgnoreCase)) ? ResponseType.InChannel : ResponseType.Ephemeral; var weatherData = await client.GetWeatherAsync(postalCode, units); var currentCondition = weatherData.WeatcherCondition.FirstOrDefault(); var unitString = units == Units.Imperial ? "F" : "C"; var currentConditionIconUrl = string.Empty; var currentConditionText = string.Empty; if (currentCondition != null) { currentConditionIconUrl = string.Format(IconUrlFormat, currentCondition.IconId); currentConditionText = $"{currentCondition.Main} - {currentCondition.Description}"; } return new SlackResponse() { ResponseType = ResponseType.Ephemeral, Text = $"Here's the current weather for {weatherData.CityName}!", Attachments = new[] { new SlackResponseAttachment() { Title = "Current Conditions", ThumbUrl = currentConditionIconUrl, Text = currentConditionText, Fields = new [] { new SlackField() { Title = "Temperature", Value = $"{Math.Round(weatherData.Weather.Temperature, 2)}° {unitString}", IsShort = true }, new SlackField() { Title = "Humidity", Value = $"{weatherData.Weather.Humidity}%", IsShort = true }, new SlackField() { Title = "Pressure", Value = $"{weatherData.Weather.Pressure} hPa", IsShort = true }, } } } }; } } catch { // TODO: don't filter critical exception types return DefaultResponse(); } return DefaultResponse(); }; }
public WeatherForecastController(ILogger <WeatherForecastController> logger, IWeatherClient client) { _logger = logger; this.client = client; }
public ForecastService(IWeatherClient weatherClient) { this.weatherClient = weatherClient; }
public WeatherService(IWeatherClient weatherClient) { this._weatherClient = weatherClient; }
public DependencyInjectionController(IWeatherClient weatherClient) { this.weatherClient = weatherClient; }
public MetaWeatherServiceAdapter(IWeatherClient client) { _client = client; }