public void TestCheckIfLoaded()
        {
            var weatherForecastService = new WeatherForecastServiceYr();
            var places    = weatherForecastService.GetAllPlaces();
            var placeList = PlaceList.Instance;

            Assert.IsFalse(placeList.IsLoaded);
            placeList.Load(places);
            Assert.IsTrue(placeList.IsLoaded);
        }
Beispiel #2
0
        private static async Task Run()
        {
            var service   = new WeatherForecastServiceYr();
            var places    = service.GetAllPlaces();
            var placeList = PlaceList.Instance;

            placeList.Load(places);

            var location        = new Location(59.13118f, 10.21665f);
            var place           = placeList.GetClosestPlace(location);
            var weatherForecast = await service.GetWeatherForecast(place);

            Console.WriteLine(weatherForecast);
        }