コード例 #1
0
        public void TestCityFromZipSpecialChars()
        {
            var geocoder = new GoogleGeocoder(ApiKey, Region);
            var cities3  = geocoder.CityFromZip(5627);

            Assert.AreEqual("Besenbüren", cities3[0]);
        }
コード例 #2
0
        public void TestCityFromZip()
        {
            var geocoder = new GoogleGeocoder(ApiKey, Region);

            Assert.IsNotNull(geocoder);

            var cities = geocoder.CityFromZip(5600);

            Assert.AreEqual(2, cities.Length);
            Assert.IsNotNull(cities.Where(c => c.Equals("Lenzburg")));
            Assert.IsNotNull(cities.Where(c => c.Equals("Ammerswil")));

            var cities2 = geocoder.CityFromZip(4852);

            Assert.AreEqual(1, cities2.Length);
            Assert.AreEqual("Rothrist", cities2[0]);
        }