public void TestOpenWeatherMapApi()
        {
            WeatherApi api      = new OpenWeatherMapApi();
            var        response = api.GetForecastOnDay(city).Result;

            Assert.IsNotNull(response);
            Assert.NotZero(response.Temp);
            Assert.NotZero(response.Humidity);
            Assert.NotZero(response.Pressure);
        }
Exemple #2
0
        public MainPageViewModel(OpenWeatherMapApi openWeatherMapApi)
        {
            openWeatherMapApi.Text = _city;

            ButtonAction = new Command(execute: async() =>
            {
                DeviceDescription = DependencyService.Get <IMyInterface>().GetPlatformName();
                await new SpeekNow().Speek(_city);
                Forecast = await openWeatherMapApi.GetWeather(_city);
            }, canExecute: () => true);
        }
Exemple #3
0
 public IHttpActionResult WeatherData(string zipcode)
 {
     try
     {
         return Ok(OpenWeatherMapApi.GetResponse(zipcode));
     }
     catch (Exception e)
     {
         logger.Error(e.Message);
         return InternalServerError();
     }
 }
        static void Main(string[] args)
        {
            ///// example and tests
            OpenWeatherMapApi Api = new OpenWeatherMapApi("secret api key", "metric", "ru");

            if (webProxy == null)
            {
                Console.WriteLine("Dasdasd");
            }
            Api.UseProxy = true;
            Console.WriteLine(Api.Current("moscow").main.temp);

            Console.WriteLine(Api.Forecast("moscow").list.First().main.temp);


            Console.ReadKey();
        }
Exemple #5
0
 public HappyHolidayMakerSteps(OpenWeatherMapApi openWeatherMapApi)
 {
     _openWeatherMapApi = openWeatherMapApi;
 }