Exemple #1
0
        public void BingMapNoResults()
        {
            BingMapConfig bmc = new BingMapConfig()
                .SetKey(BingKey);

            BingMap bing = new BingMap(bmc);

            IGeoCodeResult Target = new GeoCodeResult();

            Target = bing.GetCoordinates("alskdfjkaadsflasd");
            Assert.AreEqual(false, Target.HasValue);
            Assert.AreEqual(0, Target.Longitude);
        }
Exemple #2
0
        public void BingMapTest()
        {
            BingMapConfig bmc = new BingMapConfig()
                .SetKey(BingKey);

            BingMap bing = new BingMap(bmc);

            var Expected = new {
                Latitude = 30.267599105834961,
                Longitude = -97.74298095703125
            };
            IGeoCodeResult Target = new GeoCodeResult();

            Target = bing.GetCoordinates("Austin, TX");
            Assert.AreEqual(Expected.Latitude, Target.Latitude);
            Assert.AreEqual(Expected.Longitude, Target.Longitude);
        }
Exemple #3
0
        public void BingMapTestAlternateUrl()
        {
            BingMapConfig bmc = new BingMapConfig()
                .SetKey(BingKey)
                .SetUrl("http://dev.virtualearth.net/REST/v1/Locations/?maxResults=1")
                .SetSearchQuery("q")
                .SetKeyQuery("key");

            BingMap bing = new BingMap(bmc);

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

            IGeoCodeResult Target = new GeoCodeResult();

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