Ejemplo n.º 1
0
        public async void GetWeather_ZeroOrMines(int woeid, int expectedResult)
        {
            // 1. Arrange
            MetaWeatherService metaService = new MetaWeatherService();

            // 2. Act
            var result = await metaService.GetWeather(woeid);

            // 3. Assert
            Assert.Equal(expectedResult, result.Count);
        }
        public async Task <List <ConsolidatedWeather> > GetWeather(int woeid)
        {
            List <ConsolidatedWeather> weatherForecasts = new List <ConsolidatedWeather>();
            MetaWeatherService         metaService      = new MetaWeatherService();

            try
            {
                weatherForecasts = await metaService.GetWeather(woeid);
            }
            catch (Exception exp)
            {
                _logger.LogError(exp.Message);
            };

            return(weatherForecasts);
        }