Ejemplo n.º 1
0
        public async void BasicCoordinateSearch()
        {
            var sut       = new GeocodingServiceClient(BaseUrl, SessionId, new DummyPackageInfo());
            var addresses = await sut.Search(45.5062, -73.5726);

            Assert.True(addresses.Any());
        }
Ejemplo n.º 2
0
        public void BasicNameSearch()
        {
            var sut       = new GeocodingServiceClient(BaseUrl, SessionId, new DummyPackageInfo());
            var addresses = sut.Search("5250 ferrier");

            Assert.True(addresses.Count() == 1);
            Assert.True(addresses.ElementAt(0).FullAddress.Contains("5250"));
        }
Ejemplo n.º 3
0
        public async void SearchMiddleField()
        {
            var sut       = new GeocodingServiceClient(BaseUrl, SessionId, new DummyPackageInfo());
            var addresses = await sut.Search(45.5364, -73.6103);

            Assert.True(addresses.Any());

            Assert.False(addresses.First().StreetNumber.Contains("-"));
            Assert.False(addresses.First().FullAddress.Split(' ')[0].Contains("-"));
        }
Ejemplo n.º 4
0
        public void AdvancedNameSearch()
        {
            var sut       = new GeocodingServiceClient(BaseUrl, SessionId, new DummyPackageInfo());
            var addresses = sut.Search("5661 avenue chateaubriand, Montreal");

            Assert.AreEqual(1, addresses.Count());
            var address = addresses.ElementAt(0);

            Assert.AreEqual(true, address.FullAddress.Contains("Chateaubriand"));
            Assert.AreEqual("5661", address.StreetNumber);
            Assert.AreEqual("Avenue de Chateaubriand", address.Street);
            Assert.AreEqual("Montréal", address.City);
            StringAssert.Contains("H2S", address.ZipCode);
        }