public async Task TodayWeather() { HttpResponseMessage response = await client.GetAsync(BASE_URL + $"/location/{woeid}"); string responseBody = await response.Content.ReadAsStringAsync(); WeatherResponseList weatherResponses = JsonConvert.DeserializeObject <WeatherResponseList>(responseBody); foreach (var item in weatherResponses.wth) { if (item.AppDate.Equals(System.DateTime.Now.Date.ToString("yyyy-MM-dd"))) { Assert.Pass(); } } }
public async Task TemperatureInterval() { HttpResponseMessage response = await client.GetAsync(BASE_URL + $"/location/{woeid}"); string responseBody = await response.Content.ReadAsStringAsync(); WeatherResponseList weatherResponses = JsonConvert.DeserializeObject <WeatherResponseList>(responseBody); foreach (var item in weatherResponses.wth) { if (float.Parse(item.The_temp) > min_temp && float.Parse(item.The_temp) < max_temp) { Assert.Pass(); } else { Assert.Fail(); } } }