示例#1
0
        public async void GetWeather()
        {
            WeatherConditions weather;

            var melbourneLocation = new Location()
            {
                Latitude  = "-37.8136",
                Longitude = "144.9631"
            };
            var serializedMelbourne = JsonConvert.SerializeObject(melbourneLocation);

            var cacheRepository = new CacheRepository <WeatherConditions>(_TomataboardContext);

            var openWeatherMapService = new OpenWeatherMapService(new StubLogger <OpenWeatherMapService>(), _openWeatherMapKeys);

            weather = await openWeatherMapService.Execute(serializedMelbourne);

            Assert.NotNull(weather);

            var forecastService = new ForecastService(new StubLogger <ForecastService>(), _forecastKeys);

            weather = await forecastService.Execute(serializedMelbourne);

            Assert.NotNull(weather);

            //var yahooWeatherService = new YahooWeatherService(new StubLogger<YahooWeatherService>(), _yahooWeatherKeys);

            //var provider = new WeatherProvider(new StubLogger<WeatherProvider>(), cacheRepository, forecastService,openWeatherMapService, yahooWeatherService);
            //weather = await provider.Execute(serializedMelbourne);
            Assert.NotNull(weather);
        }