public async void GetOpenWeatherForecast_ShouldReturnTheWeatherForecast () { var openWeatherMapService = new OpenWeatherMapService (new HttpClient ()); var location = new Position { Latitude = 41.890969, Longitude = -87.676392 }; var resultTask = openWeatherMapService.Get7DayForecastAsync (location); resultTask.Wait (); Assert.IsNotNull (resultTask.Result); }
public void GetForecast_ShouldReturnA7DayForecast() { //TODO supply mock instance var openWeatherMapService = new OpenWeatherMapService (new HttpClient ()); var forecastService = new ForecastService (openWeatherMapService); var location = new Position { Latitude = 41.890969, Longitude = -87.676392 }; var resultTask = forecastService.GetForecastAsync (location); resultTask.Wait (); Assert.IsNotNull (resultTask.Result); Assert.AreEqual (resultTask.Result.WeatherList.Count, 7); }
public ForecastService(OpenWeatherMapService openWeatherMapService) { _openWeatherMapService = openWeatherMapService; }
public ForecastService (OpenWeatherMapService openWeatherMapService) { _openWeatherMapService = openWeatherMapService; }