Esempio n. 1
0
        public async Task TestSkye()
        {
            var locationFinder = new LocationFinder(new LocationFinderConfiguration {
                BingMapsKey = MAPS_KEY
            }, geocoder);

            var coords = await locationFinder.GetLocationFromStringAsync("Skye");

            Assert.NotNull(coords);
        }
Esempio n. 2
0
        public async Task TestWesternIsles()
        {
            var locationFinder = new LocationFinder(new LocationFinderConfiguration {
                BingMapsKey = MAPS_KEY
            }, geocoder);

            var coords = await locationFinder.GetLocationFromStringAsync("Stornoway");

            Assert.NotNull(coords);
            Assert.AreEqual(coords.AdminDistrict2, "Na h-Eileanan Siar");
        }
Esempio n. 3
0
        public async Task Alva()
        {
            var locationFinder = new LocationFinder(new LocationFinderConfiguration {
                BingMapsKey = MAPS_KEY
            }, geocoder);

            var coords = await locationFinder.GetLocationFromStringAsync("Alva");

            Assert.NotNull(coords);
            Assert.AreEqual(coords.AdminDistrict2, "Clackmannanshire");
        }
Esempio n. 4
0
        public async Task BaseGeoTest()
        {
            var locationFinder = new LocationFinder(new LocationFinderConfiguration {
                BingMapsKey = MAPS_KEY
            }, geocoder);

            var coords = await locationFinder.GetLocationFromStringAsync("Edinburgh");

            Assert.NotNull(coords);
            Assert.AreEqual(coords.AdminDistrict2, "City of Edinburgh");
        }
Esempio n. 5
0
        public async Task NotNullLocations(string location)
        {
            var locationFinder = new LocationFinder(new LocationFinderConfiguration {
                BingMapsKey = MAPS_KEY
            }, geocoder);

            var coords = await locationFinder.GetLocationFromStringAsync(location);

            Assert.NotNull(coords);
            System.Threading.Thread.Sleep(100);//don't overload bing
        }
Esempio n. 6
0
        public async Task TestForScotlandOnly()
        {
            Dictionary <string, string> testLocations = new Dictionary <string, string>();

            testLocations["Banff"]         = "Aberdeenshire";
            testLocations["Inverkeithing"] = "Fife";
            testLocations["Perth"]         = "Perth and Kinross";
            testLocations["johnogroats"]   = "Highland";


            var locationFinder = new LocationFinder(new LocationFinderConfiguration {
                BingMapsKey = MAPS_KEY
            }, geocoder);

            foreach (var location in testLocations)
            {
                var coords = await locationFinder.GetLocationFromStringAsync(location.Key);

                Assert.NotNull(coords);
                Assert.AreEqual(coords.AdminDistrict2, location.Value);

                System.Threading.Thread.Sleep(1000);//don't overload bing
            }
        }