public ForecastServiceTests() { _openWeatherApi = new Mock <IOpenWeatherMapApi>(); _darkSkyApi = new Mock <IDarkSkyApi>(); _cityService = new Mock <ICityService>(); _param = getForecastParam(); _forecastService = new ForecastService(_openWeatherApi.Object, _darkSkyApi.Object, _cityService.Object); }
public async Task <string> GetForecast([FromUri] ForecastParam param) { if (param == null) { return(null); } var result = await _forecastService.GetForecast(param); return(JsonConvert.SerializeObject(result)); }