Exemple #1
0
        public async void GetLocations_One(string city, int expectedResult)
        {
            // 1. Arrange
            MetaWeatherService metaService = new MetaWeatherService();

            // 2. Act
            var result = await metaService.GetLocations(city);

            // 3. Assert
            Assert.Equal(expectedResult, result[0].Woeid);
        }
        public async Task <List <Location> > GetLocations(string city)
        {
            List <Location>    locations   = new List <Location>();
            MetaWeatherService metaService = new MetaWeatherService();

            try
            {
                locations = await metaService.GetLocations(city);
            }
            catch (Exception exp)
            {
                _logger.LogError(exp.Message);
            };

            return(locations);
        }