public void CurrentWeatherTest()
        {
            OpenWeatherAPI openWeatherAPI = new OpenWeatherAPI(HttpClientFactory.CreateClient(), "a1fcc507923163ff1bae113a80d8f82a");
            var            sut            = Task.Run(() => openWeatherAPI.GetCurrentWeather(80339));

            sut.Wait();

            var json = sut.Result;
        }
示例#2
0
        public CurrentWeather GetCurrentWeather(float latitude, float longitude)
        {
            IWeatherSource weatherAPI = new OpenWeatherAPI("Enter the Open weather API key");

            return(weatherAPI.GetCurrentWeather(latitude, longitude));
        }