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)); }
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)); }
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)); }
/// <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)); }
public virtual Task <SuggestGeocodeResponse> Suggest(SuggestGeocode suggestGeocode) { return(Suggest(suggestGeocode, CancellationToken.None)); }