Ejemplo n.º 1
0
        public void GeoCoderAlternate()
        {
            var Expected = new
            {
                Latitude  = 30.1968545,
                Longitude = -97.5975533560703
            };

            IGeoCodeResult Target = new GeoCodeResult();

            GeoCoder gc = new GeoCoder();

            gc.AddProvider(new OpenStreetMap());
            Target = gc.GetCoordinates("Austin, TX");
            Assert.AreEqual(Expected.Latitude, Target.Latitude);
            Assert.AreEqual(Expected.Longitude, Target.Longitude);
        }
Ejemplo n.º 2
0
        public void GeoCoderBingTest()
        {
            GeoCoder      gc  = new GeoCoder();
            BingMapConfig bmc = new BingMapConfig()
                                .SetKey(BingKey);

            gc.AddProvider(new BingMap(bmc));  // bing requires a key

            IGeoCodeResult Target = new GeoCodeResult();

            var Expected = new{
                Latitude  = 30.267599105834961,
                Longitude = -97.74298095703125
            };

            Target = gc.GetCoordinates("Austin, TX");
            Assert.AreEqual(Expected.Latitude, Target.Latitude);
            Assert.AreEqual(Expected.Longitude, Target.Longitude);
        }