Example #1
0
        public void GetWeatherItems_GivenBelfastAsLocation()
        {
            string             location = "belfast";
            MetaWeatherService service  = new MetaWeatherService();

            var weatherItems = service.GetWeatherItems(location);

            Assert.AreEqual(6, weatherItems.Count());
        }
        private WeatherForecastViewModel GetWeatherData(string location)
        {
            IWeatherService service = new MetaWeatherService();

            var weatherItems = service.GetWeatherItems(location);
            var top5Items    = weatherItems.Count() > 4 ? weatherItems.Take(5) : weatherItems;

            WeatherForecastViewModel model = new WeatherForecastViewModel
            {
                WeatherItems = top5Items,
                Location     = location
            };

            return(model);
        }