public Api(ApiKeys apiKeys, HttpClient httpClient = null)
 {
     Security            = new Security(apiKeys, httpClient: httpClient);
     findService         = new FindService(apiKeys.AddressLookupKey, httpClient: httpClient);
     autocompleteService = new AutocompleteService(apiKeys.AddressLookupKey, httpClient: httpClient);
     getService          = new GetService(apiKeys.AddressLookupKey, httpClient: httpClient);
     typeaheadService    = new TypeaheadService(apiKeys.AddressLookupKey, httpClient: httpClient);
     EmailNotifications  = new EmailNotifications(apiKeys.AdministrationKey, httpClient: httpClient);
     usageService        = new UsageService(apiKeys.AdministrationKey, httpClient: httpClient);
     distanceService     = new DistanceService(apiKeys.AddressLookupKey, httpClient: httpClient);
     Subscription        = new SubscriptionService(apiKeys.AdministrationKey, httpClient: httpClient);
     Plans          = new PlansService(apiKeys.AdministrationKey, httpClient: httpClient);
     Webhooks       = new Webhooks(apiKeys.AdministrationKey, httpClient: httpClient);
     Account        = new Account(apiKeys.AdministrationKey, httpClient: httpClient);
     Invoice        = new InvoiceService(apiKeys.AdministrationKey, httpClient: httpClient);
     PrivateAddress = new PrivateAddressService(apiKeys.AdministrationKey, httpClient: httpClient);
     DirectDebt     = new DirectDebtService(apiKeys.AdministrationKey, httpClient: httpClient);
 }
示例#2
0
        public async Task SearchUser()
        {
            using (var transaction = Fixture.Connection.BeginTransaction())
            {
                using (var context = Fixture.CreateContext(transaction))
                {
                    TypeaheadService typeaheadService = new TypeaheadService(context);

                    SearchUserRequest request = new SearchUserRequest
                    {
                        SearchParameter = "Test User",
                    };

                    SearchUserReply actualReply = await typeaheadService.SearchUser(request, TestServerCallContext.Create("fooMethod", "test.example.com", DateTime.UtcNow.AddHours(1), new Metadata(), CancellationToken.None, "127.0.0.1", null, null, (metadata) => TaskUtils.CompletedTask, () => new WriteOptions(), (writeOptions) => { }));

                    Assert.Equal(2, actualReply.Entries.Count);
                }
            }
        }