public async Task GetWeatherByWOEID_Name_Should_be_Equal() { //Arrange var WOEID = 2357024; var WeatherSearchResponse = new WeatherSearchResponse() { consolidated_weather = new List <ConsolidatedWeather>() { new ConsolidatedWeather() { created = DateTime.Now, min_temp = 24.77f, predictability = 71 } }, title = "Atlanta" }; //Act var getResponse = "{\"consolidated_weather\":[{\"id\":6626227894878208,\"weather_state_name\":\"Heavy Cloud\",\"weather_state_abbr\":\"hc\",\"wind_direction_compass\":\"WSW\",\"created\":\"2020-09-02T04:01:43.761599Z\",\"applicable_date\":\"2020-09-02\",\"min_temp\":24.77,\"max_temp\":30.200000000000003,\"the_temp\":30.259999999999998,\"wind_speed\":5.478668238633051,\"wind_direction\":245.03471555900433,\"air_pressure\":1016.0,\"predictability\":71}],\"title\":\"Atlanta\"}"; var getRestResponse = restClientMock.Setup(x => x.RestclientCall()).ReturnsAsync(getResponse); var getresult = await metaWeatherOrchestration.GetWeatherByWOEID(WOEID); //Assert Assert.Equal(WeatherSearchResponse.title.ToLower(), getresult.title.ToLower()); }
public async Task GetWeatherByWOEID_Should_null() { var WOEID = 2357024; var WeatherSearchResponse = new WeatherSearchResponse() { consolidated_weather = new List <ConsolidatedWeather>() { new ConsolidatedWeather() { created = DateTime.Now, min_temp = 24.77f, predictability = 71 } }, title = "Atlanta" }; //Act var getRestResponse = restClientMock.Setup(x => x.RestclientCall()).ReturnsAsync(string.Empty); var getresult = await metaWeatherOrchestration.GetWeatherByWOEID(WOEID); //Assert Assert.Null(getresult); }