コード例 #1
0
        private static void TestUSAutocompleteRequestReturnsWithCorrectNumberOfResults(ICredentials credentials)
        {
            var client = new ClientBuilder(credentials).WithCustomBaseUrl(Environment.GetEnvironmentVariable("SMARTY_URL_US_AUTOCOMPLETE")).RetryAtMost(0).BuildUsAutocompleteApiClient();
            var lookup = new SmartyStreets.USAutocompleteApi.Lookup("4770 Lincoln Ave O");

            lookup.AddStateFilter("IL");

            try
            {
                client.Send(lookup);
            }
            catch (Exception)
            {
                Console.Write("");
            }

            var suggestions = 0;

            if (lookup.Result != null)
            {
                suggestions = lookup.Result.Length;
            }

            AssertResults("US_Autocomplete", suggestions, 9);
        }
コード例 #2
0
        public static void TestUSAutocompleteRequestReturnsWithCorrectNumberOfResults(StaticCredentials credentials)
        {
            var client = new ClientBuilder(credentials).RetryAtMost(0).BuildUsAutocompleteApiClient();
            var lookup = new SmartyStreets.USAutocompleteApi.Lookup("4770 Lincoln Ave O");

            lookup.AddStateFilter("IL");

            try
            {
                client.Send(lookup);
            }
            catch (Exception) { Console.Write(""); }

            int suggestions = 0;

            if (lookup.Result != null)
            {
                suggestions = lookup.Result.Length;
            }

            AssertResults("US_Autocomplete", suggestions, 9);
        }