コード例 #1
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));
        }
コード例 #2
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));
        }