Beispiel #1
0
        public async void when_place_then_detail()
        {
            try
            {
                var refService = new SearchLocationsServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);
                var addresses  = await refService.Search("yul", 45.4982111, -73.6565887);

                if (!addresses.Any())
                {
                    Assert.Inconclusive("no places returned");
                }

                var a1 = addresses.ElementAt(0);
                Assert.IsNotNullOrEmpty(a1.PlaceId);

                var sut     = new PlaceDetailServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);
                var address = await sut.GetPlaceDetail(a1.PlaceId, a1.FriendlyName);

                Assert.AreNotEqual(0, address.Latitude);
                Assert.AreNotEqual(0, address.Longitude);
                Assert.IsNotNullOrEmpty(address.FullAddress);
                Assert.IsNotNullOrEmpty(address.Street);
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }
Beispiel #2
0
        public async void when_number_then_postal()
        {
            var sut       = new SearchLocationsServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);
            var addresses = await sut.Search("5661 avenue chateaubriand", 45.5227967351675, -73.6242310144007);

            Assert.True(addresses.Any());
            Assert.True(addresses.ElementAt(0).AddressType.Contains("postal"));
        }
Beispiel #3
0
        public async void when_name_then_places()
        {
            var sut       = new SearchLocationsServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);
            var addresses = await sut.Search("restaurant", 45.4983, -73.6586);

            if (!addresses.Any())
            {
                Assert.Inconclusive("no places returned");
            }

            Assert.True(addresses.Any());
            Assert.True(addresses.Any(x => x.AddressType.Contains("place")));
        }