Exemplo n.º 1
0
 public void WhenSearchingForADisqualifiedOfficers()
 {
     _result = _client.SearchDisqualifiedOfficerAsync(new SearchRequest()
     {
         Query = "Kevin"
     }).Result;
 }
        public async Task GivenACompanyHouseSearchClient_WhenSearchingForAOfficer()
        {
            var fixture = new Fixture();
            var items = fixture.Build<Item>()
                .With(x => x.Kind, "searchresults#officer")
                .CreateMany().ToArray();
            _resourceDetails = fixture.Build<ResourceDetails>()
                .With(x => x.Officers, items)
                .Create();
            
            var uri = new Uri("https://wibble.com/search/companies");

            var resource = new OfficerSearchResourceBuilder()
                .CreateResource(_resourceDetails);

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock<ISearchUriBuilder>();
            uriBuilder.Setup(x => x.Build(It.IsAny<SearchRequest>()))
                .Returns(uri);

            var uriBuilderFactory = new Mock<ISearchUriBuilderFactory>();
            uriBuilderFactory.Setup(x => x.Create<OfficerSearch>())
                .Returns(uriBuilder.Object);

            _client = new CompaniesHouseSearchClient(new HttpClient(handler), uriBuilderFactory.Object);

            _result = await _client.SearchAsync<OfficerSearch>(new SearchRequest());
        }
Exemplo n.º 3
0
 public void WhenSearchingForAOfficer()
 {
     _result = _client.SearchOfficerAsync(new SearchRequest()
     {
         Query = "Kevin"
     }).Result;
 }
        public void GivenACompaniesHouseCompanyProfileClient_WhenGettingACompanyProfile(CompaniesHouseCompanyChargesClientTestCase testCase)
        {
            _companyCharges = new CompanyChargesBuilder().Build(testCase);
            var resource = new CompanyChargesResourceBuilder(_companyCharges)
                           .Create();

            var uri = new Uri("https://wibble.com/search/companies");

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock <ICompanyChargesUriBuilder>();

            uriBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>()))
            .Returns(uri);

            var uriItemBuilder = new Mock <IChargeItemUriBuilder>();

            uriItemBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(uri);


            _client = new CompaniesHouseCompanyChargesClient(new HttpClient(handler), uriBuilder.Object, uriItemBuilder.Object);

            _result = _client.GetCompanyChargesAsync("abc", 0, 25).Result;

            _result.Data.ShouldBeEquivalentTo(_companyCharges, options => options.ComparingEnumsByName());
        }
        public async Task GivenACompanyHouseSearchClient_WhenSearchingForAOfficer()
        {
            var fixture = new Fixture();
            var items   = fixture.Build <Item>()
                          .With(x => x.Kind, "searchresults#officer")
                          .CreateMany().ToArray();

            _resourceDetails = fixture.Build <ResourceDetails>()
                               .With(x => x.Officers, items)
                               .Create();

            var uri = new Uri("https://wibble.com/search/companies");

            var resource = new OfficerSearchResourceBuilder()
                           .CreateResource(_resourceDetails);

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock <ISearchUriBuilder>();

            uriBuilder.Setup(x => x.Build(It.IsAny <SearchRequest>()))
            .Returns(uri);

            var uriBuilderFactory = new Mock <ISearchUriBuilderFactory>();

            uriBuilderFactory.Setup(x => x.Create <OfficerSearch>())
            .Returns(uriBuilder.Object);

            _client = new CompaniesHouseSearchClient(new HttpClient(handler), uriBuilderFactory.Object);

            _result = await _client.SearchAsync <OfficerSearch>(new SearchRequest());
        }
        public void GivenACompanyHouseSearchCompanyClient_WhenSearchingForACompany()
        {
            var fixture = new Fixture();
            _resourceDetails = fixture.Create<ResourceDetails>();
            _expectedCompanies = new List<CompanyDetails>
            {
                fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, "active").With(x => x.CompanyType, "private-unlimited").Create(),
                fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, "dissolved").With(x => x.CompanyType, "private-unlimited").Create(),
                fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, "liquidation").With(x => x.CompanyType, "private-unlimited").Create(),
                fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, "receivership").With(x => x.CompanyType, "private-unlimited").Create(),
                fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, "administration").With(x => x.CompanyType, "private-unlimited").Create(),
                fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, "voluntary-arrangement").With(x => x.CompanyType, "private-unlimited").Create(),
                fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, "converted-closed").With(x => x.CompanyType, "private-unlimited").Create(),
                fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, "insolvency-proceedings").With(x => x.CompanyType, "private-unlimited").Create(),
            };

            var uri = new Uri("https://wibble.com/search/companies");

            var resource = new CompanySearchResourceBuilder()
                .AddCompanies(_expectedCompanies)
                .CreateResource(_resourceDetails);

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);
            var httpClientFactory = new Mock<IHttpClientFactory>();
            httpClientFactory.Setup(x => x.CreateHttpClient())
                .Returns(new HttpClient(handler));

            var uriBuilder = new Mock<ICompanySearchUriBuilder>();
            uriBuilder.Setup(x => x.Build(It.IsAny<CompanySearchRequest>()))
                .Returns(uri);

            _client = new CompaniesHouseSearchCompanyClient(httpClientFactory.Object, uriBuilder.Object);

            _result = _client.SearchCompanyAsync(new CompanySearchRequest()).Result;
        }
Exemplo n.º 7
0
        private static void DisplayResults(CompaniesHouseClientResponse <AllSearch> result, string nameSearchedFor)
        {
            //Show all companies found
            Console.WriteLine($"{Environment.NewLine}----------------------------------------------");
            Console.WriteLine($"Companies found when searching for '{nameSearchedFor}' :");
            foreach (Company item in result.Data.Items.Where(t => t as Company != null))
            {
                Console.WriteLine($"* {item.Title} - {item.Description} - {item.CompanyStatus}");
            }

            //Show all Officers found
            Console.WriteLine($"{Environment.NewLine}----------------------------------------------");
            Console.WriteLine($"Officers found when searching for '{nameSearchedFor}' :");
            foreach (Officer item in result.Data.Items.Where(t => t as Officer != null))
            {
                Console.WriteLine($"* {item.Title} - {item.Description}");
            }

            //Show all Disqualified Officers found
            Console.WriteLine($"{Environment.NewLine}----------------------------------------------");
            Console.WriteLine($"Disqualified Officers found when searching for '{nameSearchedFor}' :");
            foreach (DisqualifiedOfficer item in result.Data.Items.Where(t => t as DisqualifiedOfficer != null))
            {
                Console.WriteLine($"* {item.Title}");
            }
        }
Exemplo n.º 8
0
 public void WhenSearchingForACompany()
 {
     _result = _client.SearchCompanyAsync(new CompanySearchRequest()
     {
         Query = _query
     }).Result;
 }
Exemplo n.º 9
0
        public void GivenACompaniesHouseCompanyProfileClient_WhenGettingACompanyProfile(CompaniesHouseCompanyFilingHistoryClientTestCase testCase)
        {
            _companyFilingHistory = new CompanyFilingHistoryBuilder().Build(testCase);
            var resource = new CompanyFilingHistoryResourceBuilder(_companyFilingHistory)
                           .Create();

            var uri = new Uri("https://wibble.com/search/companies");

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);
            var httpClientFactory      = new Mock <IHttpClientFactory>();

            httpClientFactory.Setup(x => x.CreateHttpClient())
            .Returns(new HttpClient(handler));

            var uriBuilder = new Mock <ICompanyFilingHistoryUriBuilder>();

            uriBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>()))
            .Returns(uri);

            _client = new CompaniesHouseCompanyFilingHistoryClient(httpClientFactory.Object, uriBuilder.Object);

            _result = _client.GetCompanyFilingHistoryAsync("abc", 0, 25).Result;

            _result.Data.ShouldBeEquivalentTo(_companyFilingHistory);
        }
Exemplo n.º 10
0
 public async Task WhenSearching()
 {
     _result = await _client.SearchAllAsync(new SearchRequest()
     {
         Query = _query
     });
 }
Exemplo n.º 11
0
 public void WhenSearchingForACompany()
 {
     _result = _client.SearchCompanyAsync(new SearchRequest()
     {
         Query = _query, StartIndex = 0, ItemsPerPage = 100
     }).Result;
 }
Exemplo n.º 12
0
 public async Task WhenSearchingForAOfficer()
 {
     _result = await _client.SearchOfficerAsync(new SearchRequest()
     {
         Query = "Kevin"
     })
               .ConfigureAwait(false);
 }
 public async Task WhenSearchingForACompany()
 {
     _result = await _client.SearchCompanyAsync(new SearchRequest()
     {
         Query = _query, StartIndex = 0, ItemsPerPage = 100
     })
               .ConfigureAwait(false);
 }
Exemplo n.º 14
0
 public async Task WhenSearching()
 {
     _result = await _client.SearchAllAsync(new SearchRequest()
     {
         Query = _query
     })
               .ConfigureAwait(false);
 }
Exemplo n.º 15
0
        public async Task GivenAClient_WhenDownloadingDocument()
        {
            var requestUri             = new Uri($"https://document-api.companieshouse.gov.uk/document/{DocumentId}/content");
            var stubHttpMessageHandler = new StubHttpMessageHandler(requestUri, ExpectedContent, ExpectedMediaType);
            var mockUriBuilder         = new Mock <IDocumentUriBuilder>();

            mockUriBuilder.Setup(x => x.Build(DocumentId)).Returns(requestUri);

            _result = await new CompaniesHouseDocumentDownloadClient(new HttpClient(stubHttpMessageHandler), mockUriBuilder.Object).DownloadDocumentAsync(DocumentId);
        }
Exemplo n.º 16
0
        public void GivenAClient_WhenGettingDocumentMetadata()
        {
            _expected = SetupExpectedDocumentMetadata();
            var requestUri             = new Uri($"https://document-api.companieshouse.gov.uk/document/{DocumentId}");
            var stubHttpMessageHandler = SetupApiResponse(_expected, requestUri);
            var mockUriBuilder         = SetupRequestUri(requestUri);

            _result = new CompaniesHouseDocumentMetadataClient(new HttpClient(stubHttpMessageHandler), mockUriBuilder.Object)
                      .GetDocumentMetadataAsync(DocumentId).Result;
        }
        public void GivenACompaniesHouseCompanyProfileClient_WhenGettingACompanyProfile()
        {
            _peopleWithSignificantControl = new CompaniesHousePersonsWithSignificantControlBuilder().Build();
            var resource = new CompanyPersonsWithSignificantControlResourceBuilder(_peopleWithSignificantControl).Create();

            var uri = new Uri("https://wibble.com/search/companies");

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock <IPersonsWithSignificantControlUriBuilder>();

            uriBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>()))
            .Returns(uri);

            var uriIndividualBuilder = new Mock <IPersonsWithSignificantControlIndividualUriBuilder>();

            uriIndividualBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(uri);

            var uriStatementItemBuilder = new Mock <IPersonsWithSignificantControlStatementItemUriBuilder>();

            uriStatementItemBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(uri);

            var uriStatementsBuilder = new Mock <IPersonsWithSignificantControlStatementsUriBuilder>();

            uriStatementsBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>()))
            .Returns(uri);

            var uriSuperSecureBuilder = new Mock <IPersonsWithSignificantControlSuperSecurePersonUriBuilder>();

            uriSuperSecureBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(uri);
            var uriCorporateBuilder = new Mock <IPersonsWithSignificantControlUriCorporateEntitiesBuilder>();

            uriCorporateBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(uri);

            var uriLegalPersonBuilder = new Mock <IPersonsWithSignificantControlUriLegalPersonBuilder>();

            uriLegalPersonBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(uri);

            _client = new CompaniesHousePersonsWithSignificantControlClient(new HttpClient(handler), uriBuilder.Object, uriIndividualBuilder.Object, uriStatementsBuilder.Object, uriStatementItemBuilder.Object, uriSuperSecureBuilder.Object, uriCorporateBuilder.Object, uriLegalPersonBuilder.Object);

            _result = _client.GetPersonsWithSignificanControlAsync("abc", 0, 25).Result;

            _result.Data.ShouldBeEquivalentTo(_peopleWithSignificantControl);
        }
Exemplo n.º 18
0
        public void GivenACompanyHouseSearchCompanyClient_WhenSearchingForACompany()
        {
            var fixture = new Fixture();

            _resourceDetails   = fixture.Create <ResourceDetails>();
            _expectedCompanies = new List <CompanyDetails>
            {
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "active").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "dissolved").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "liquidation").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "receivership").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "administration").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "voluntary-arrangement").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "converted-closed").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "insolvency-proceedings").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "open").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "closed").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "closed-on").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
                //fixture.Build<CompanyDetails>().With(x => x.CompanyStatus, null).With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create(),
            };

            var uri = new Uri("https://wibble.com/search/companies");

            _companyWithUnknownDateOfCessation = fixture.Build <CompanyDetails>().With(x => x.CompanyStatus, "insolvency-proceedings").With(x => x.CompanyType, "private-unlimited").With(x => x.Kind, "searchresults#company").Create();
            var resource = new CompanySearchResourceBuilder()
                           .AddCompanies(_expectedCompanies)
                           .AddCompanyWithUnknownDateOfCessation(_companyWithUnknownDateOfCessation)
                           .CreateResource(_resourceDetails);

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock <ISearchUriBuilder>();

            uriBuilder.Setup(x => x.Build(It.IsAny <SearchRequest>()))
            .Returns(uri);

            var uriBuilderFactory = new Mock <ISearchUriBuilderFactory>();

            uriBuilderFactory.Setup(x => x.Create <CompanySearch>())
            .Returns(uriBuilder.Object);

            _client = new CompaniesHouseSearchClient(new HttpClient(handler), uriBuilderFactory.Object);

            _result = _client.SearchAsync <CompanySearch>(new SearchRequest()).Result;
        }
        public void GivenACompaniesHouseCompanyProfileClient_WhenGettingACompanyProfile()
        {
            _officers = new OfficersBuilder().Build();
            var resource = new OfficersResourceBuilder(_officers).Create();

            var uri = new Uri("https://wibble.com/search/companies");

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock<IOfficersUriBuilder>();
            uriBuilder.Setup(x => x.Build(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
                .Returns(uri);

            _client = new CompaniesHouseOfficersClient(new HttpClient(handler), uriBuilder.Object);

            _result = _client.GetOfficersAsync("abc", 0, 25).Result;

            _result.Data.ShouldBeEquivalentTo(_officers);
        }
Exemplo n.º 20
0
        public void GivenACompaniesHouseCompanyProfileClient_WhenGettingACompanyProfile()
        {
            _officers = new OfficersBuilder().Build();
            var resource = new OfficersResourceBuilder(_officers).Create();

            var uri = new Uri("https://wibble.com/search/companies");

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock <IOfficersUriBuilder>();

            uriBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>()))
            .Returns(uri);

            _client = new CompaniesHouseOfficersClient(new HttpClient(handler), uriBuilder.Object);

            _result = _client.GetOfficersAsync("abc", 0, 25).Result;

            _result.Data.ShouldBeEquivalentTo(_officers);
        }
Exemplo n.º 21
0
        public void GivenACompaniesHouseCompanyProfileClient_WhenGettingPersonsWithSignificantControl()
        {
            _personsWithSignificantControl = new PersonsWithSignificantControlBuilder().Build();
            var resource = new PersonsWithSignificantControlResourceBuilder(_personsWithSignificantControl).Create();

            var uri = new Uri("https://wibble.com/search/companies");

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock <IPersonsWithSignificantControlBuilder>();

            uriBuilder.Setup(x => x.Build(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>()))
            .Returns(uri);

            _client = new CompaniesHousePersonsWithSignificantControlClient(new HttpClient(handler), uriBuilder.Object);

            _result = _client.GetPersonsWithSignificantControlAsync("abc", 0, 25).Result;

            _result.Data.ShouldBeEquivalentTo(_personsWithSignificantControl);
        }
        public void GivenACompaniesHouseCompanyProfileClient_WhenGettingACompanyProfile(CompaniesHouseCompanyFilingHistoryClientTestCase testCase)
        {
            _companyFilingHistory = new CompanyFilingHistoryBuilder().Build(testCase);
            var resource = new CompanyFilingHistoryResourceBuilder(_companyFilingHistory)
                                .Create();

            var uri = new Uri("https://wibble.com/search/companies");

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock<ICompanyFilingHistoryUriBuilder>();
            uriBuilder.Setup(x => x.Build(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
                .Returns(uri);

            _client = new CompaniesHouseCompanyFilingHistoryClient(new HttpClient(handler), uriBuilder.Object);

            _result = _client.GetCompanyFilingHistoryAsync("abc", 0, 25).Result;

            _result.Data.ShouldBeEquivalentTo(_companyFilingHistory);
        }
Exemplo n.º 23
0
        public void GivenACompaniesHouseCompanyProfileClient_WhenGettingACompanyProfile(CompaniesHouseCompanyProfileClientTestCase testCase)
        {
            _companyProfile = new CompanyProfileBuilder().Build(testCase);
            var resource = new CompanyProfileResourceBuilder(_companyProfile)
                           .Create();

            var uri = new Uri("https://wibble.com/search/companies");

            HttpMessageHandler handler = new StubHttpMessageHandler(uri, resource);

            var uriBuilder = new Mock <ICompanyProfileUriBuilder>();

            uriBuilder.Setup(x => x.Build(It.IsAny <string>()))
            .Returns(uri);

            _client = new CompaniesHouseCompanyProfileClient(new HttpClient(handler), uriBuilder.Object);

            _result = _client.GetCompanyProfileAsync("abc").Result;

            _result.Data.ShouldBeEquivalentTo(_companyProfile);
        }
 public void WhenSearchingForADisqualifiedOfficers()
 {
     _result = _client.SearchDisqualifiedOfficerAsync(new SearchRequest() { Query = "Kevin" }).Result;
 }
 private async Task WhenRetrievingAnCompanyFilingHistoryForAnInvalidCompany()
 {
     _result = await _client.GetCompanyFilingHistoryAsync(InvalidCompanyNumber);
 }
 private async Task WhenRetrievingAnCompanyChargesForAnInvalidCompany()
 {
     _result = await _client.GetCompanyChargesAsync(InvalidCompanyNumber);
 }
Exemplo n.º 27
0
 public async Task WhenSearching()
 {
     _result = await _client.GetCompanyInsolvencyInformationAsync("08749409")
               .ConfigureAwait(false);
 }
 public async Task WhenSearching()
 {
     _result = await _client.SearchAllAsync(new SearchRequest() { Query = _query });
 }
Exemplo n.º 29
0
 private async Task WhenRetrievingAnCompanyFilingHistoryForAnInvalidCompany()
 {
     _result = await _client.GetCompanyFilingHistoryAsync(InvalidCompanyNumber)
               .ConfigureAwait(false);
 }
 public async Task WhenSearching()
 {
     _result = await _client.GetCompanyInsolvencyInformationAsync("08749409");
 }
Exemplo n.º 31
0
 private async Task DownloadingDocument() => _result = await Client.DownloadDocumentAsync(DocumentId);
 public void WhenSearchingForAOfficer()
 {
     _result = _client.SearchOfficerAsync(new SearchRequest() { Query = "Kevin" }).Result;
 }
Exemplo n.º 33
0
        static async Task Main(string[] args)
        {
            string api_key = ""; //Add your api key from companies house api here https://developer.companieshouse.gov.uk/developer/applications

            if (!api_key.Any())
            {
                Console.WriteLine($"No API Key found. Please edit Program.cs to add it in.");
                return;
            }

            Console.WriteLine($"Starting up - Found this api key: {api_key}");
            CompaniesHouseClientResponse <CompaniesHouse.Response.Search.AllSearch.AllSearch> result = null;
            string nameToSearchFor = "Bigman";
            var    settings        = new CompaniesHouseSettings(api_key);

            using (var client = new CompaniesHouseClient(settings))
            {
                var request = new SearchRequest()
                {
                    Query        = nameToSearchFor,
                    StartIndex   = 0,
                    ItemsPerPage = 10
                };

                result = await client.SearchAllAsync(request);
            }

            DisplayResults(result, nameToSearchFor);
        }
 public void WhenSearchingForACompany()
 {
     _result = _client.SearchCompanyAsync(new CompanySearchRequest() {Query = "Liberis"}).Result;
 }
 private async Task WhenRetrievingAnCompanyFilingHistoryForAnInvalidCompany()
 {
     _result = await _client.GetFilingHistoryByTransactionAsync(InvalidCompanyNumber, InvalidTransactionId)
               .ConfigureAwait(false);
 }
 public void WhenSearchingForACompany()
 {
     _result = _client.SearchCompanyAsync(new SearchRequest() { Query = _query }).Result;
 }
 private async Task WhenRetrievingAnCompanyPersonsWithSignificanControlForAnInvalidCompany()
 {
     _result = await _client.GetPersonsWithSignificanControlAsync(InvalidCompanyNumber, 0, 25);
 }