Example #1
0
        public async void TestgetWeatherByLocation()
        {
            var res = await _wModel.GetWeatherByLocation("Nantes");

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

            res = await _wModel.GetWeatherByLocation("azydguziehoizjefoijzoiefjoizejfoizjeoifj");

            Assert.Null(res.Name);
        }
Example #2
0
        /**
         * @brief get the wheather from a city which is a string
         *
         * @return a view
         */
        public async Task <IActionResult> index(string city)
        {
            var res = await _model.GetWeatherByLocation(city);

            return(View(res));
        }