Exemplo n.º 1
0
        public async void TestgetWeatherByCoord()
        {
            var res = await _wModel.GetWeatherByCoord(20, 20);

            Assert.Equal("", res.Name);
            Assert.NotEqual("", res.Main.Temp);
            Assert.NotEmpty(res.Weather);

            res = await _wModel.GetWeatherByCoord(987198, 8118212112);

            Assert.Null(res.Name);
        }
Exemplo n.º 2
0
        /**
         * @brief get the wheather from the latitutde and the longitude which are floats
         *
         * @return a view
         */
        public async Task <IActionResult> index(float lat, float lon)
        {
            var res = await _model.GetWeatherByCoord(lat, lon);

            return(View(res));
        }