public static async Task GetWeatherByCityCountry() { string cityName = "London"; string countryName = "uk"; OpenWeatherService ows = new OpenWeatherService(); dynamic res = await ows.GetWeather(cityName, countryName); }
public async Task Get_Weather_With_Incorrect_City_Name_Should_Throw_HTTP_Request_Exception() { //arrange var weatherService = new OpenWeatherService(new ApiClientMock(), new MappingService()); var wrongData = TestDataValues.INCORRECT_CITY_NAME; //assert await Assert.ThrowsAsync <HttpRequestException>(async() => await weatherService.GetWeather(wrongData)); }
public async Task Get_Weather_With_Correct_City_Name_Should_Return_Weather_Summary() { //arrange var weatherService = new OpenWeatherService(new ApiClientMock(), new MappingService()); //act var result = await weatherService.GetWeather(TestDataValues.CORRECT_CITY_NAME); //assert Assert.NotNull(result); Assert.IsType <WeatherSummary>(result); }
public static async Task GetWeatherByCityId() { string cityId = "2172797"; OpenWeatherService ows = new OpenWeatherService(); dynamic res = await ows.GetWeather(cityId); }