예제 #1
0
        public async Task CanSuggest()
        {
            var gateway = new GeocodeGateway(new ServiceStackSerializer());
            var suggest = new SuggestGeocode("/World/GeocodeServer/".AsEndpoint())
            {
                Text = "100 Willis Street, Wellington"
            };
            var response = await gateway.Suggest(suggest);

            Assert.Null(response.Error);
            Assert.NotNull(response.Suggestions);
            Assert.True(response.Suggestions.Any());
            var result = response.Suggestions.First();

            Assert.True(!string.IsNullOrWhiteSpace(result.Text));
        }
예제 #2
0
        public async Task CanSuggest(string rootUrl, string relativeUrl, string text)
        {
            var gateway = new PortalGateway(rootUrl);
            var suggest = new SuggestGeocode(relativeUrl.AsEndpoint())
            {
                Text = text
            };
            var response = await gateway.Suggest(suggest);

            Assert.Null(response.Error);
            Assert.NotNull(response.Suggestions);
            Assert.True(response.Suggestions.Any());
            var result = response.Suggestions.First();

            Assert.True(!string.IsNullOrWhiteSpace(result.Text));
        }
예제 #3
0
        public async Task CanSuggest(string rootUrl, string relativeUrl, string text)
        {
            var gateway = new PortalGateway(rootUrl);
            var suggest = new SuggestGeocode(relativeUrl)
            {
                Text = text
            };
            var response = await IntegrationTestFixture.TestPolicy.ExecuteAsync(() =>
            {
                return(gateway.Suggest(suggest));
            });

            Assert.Null(response.Error);
            Assert.NotNull(response.Suggestions);
            Assert.True(response.Suggestions.Any());
            var result = response.Suggestions.First();

            Assert.True(!string.IsNullOrWhiteSpace(result.Text));
        }
예제 #4
0
 /// <summary>
 /// Call the suggest geocode operation.
 /// </summary>
 /// <param name="suggestGeocode"></param>
 /// <param name="ct">Optional cancellation token to cancel pending request</param>
 /// <returns></returns>
 public virtual Task <SuggestGeocodeResponse> Suggest(SuggestGeocode suggestGeocode, CancellationToken ct = default(CancellationToken))
 {
     return(Get <SuggestGeocodeResponse, SuggestGeocode>(suggestGeocode, ct));
 }
예제 #5
0
 public virtual Task <SuggestGeocodeResponse> Suggest(SuggestGeocode suggestGeocode)
 {
     return(Suggest(suggestGeocode, CancellationToken.None));
 }