public void GivenARunningApiWhenSearchingForACompany()
        {
            var name = "GG";
            var apiKey = Guid.NewGuid().ToString();
            _resource = new MockResource(new ResourceIdentifier("GET", CreateCompaniesPath(), $"?api_key={apiKey}&filters={{\"name\":\"{name}\"}}"));
            _resource.ReturnsBody(JsonSearchResponse);

            _api = new Api();
            _api.RegisterResource(_resource);
            _api.Start();

            var client = new DueDilClientFactory(new DueDilSettings(_api.Uri, apiKey, _sandboxMode)).CreateClient();

            _actual = client.SearchCompaniesAsync(new Terms(){Name = name}).Result;
        }
Esempio n. 2
0
        public void GivenARunningApiWhenGettingACompany()
        {
            var companyId = Guid.NewGuid().ToString();
            var apiKey = Guid.NewGuid().ToString();
            _resource = new MockResource(new ResourceIdentifier("GET", CreateCompanyPath(companyId), $"?api_key={apiKey}"));
            _resource.ReturnsBody(JsonSearchResponse);

            _api = new Api();
            _api.RegisterResource(_resource);
            _api.Start();

            var client = new DueDilClientFactory(new DueDilSettings(_api.Uri, apiKey, _sandboxMode)).CreateClient();

            _actual = client.GetCompanyAsync(Locale.Uk, companyId).Result;
        }
Esempio n. 3
0
 public void RegisterResource(MockResource resource)
 {
     _resources[resource.Identifier] = resource;
 }
Esempio n. 4
0
 public void RegisterResource(MockResource resource)
 {
     _resources[resource.Identifier] = resource;
 }