예제 #1
0
        public async Task AssociationClient_fail_create_batch_Association()
        {
            var mockHttpClient = new MockRapidHttpClient()
                                 .AddTestCase(new CreateBatchAssociationMockFailTestCase());
            var localClient = new HubSpotAssociationsClient(
                mockHttpClient,
                Logger,
                new RequestSerializer(new RequestDataConverter(LoggerFactory.CreateLogger <RequestDataConverter>())),
                "https://api.hubapi.com/",
                "HapiKeyFisk"
                );


            await Assert.ThrowsAsync <HubSpotException>(async() =>
            {
                var entities = new List <AssociationHubSpotEntity>
                {
                    new AssociationHubSpotEntity
                    {
                        FromObjectId = 10444744,
                        ToObjectId   = 259674,
                        DefinitionId = (int)HubSpotAssociationDefinitions.CompanyToContact
                    },
                    new AssociationHubSpotEntity
                    {
                        FromObjectId = 10444744,
                        ToObjectId   = 259727,
                        DefinitionId = (int)HubSpotAssociationDefinitions.CompanyToContact
                    }
                };
                _ = await localClient.CreateBatch(entities, HubSpotAssociationDefinitions.CompanyToContact);
            });
        }
예제 #2
0
        public MockRapidHttpClientTests()
        {
            testCase1 = A.Fake <IMockRapidHttpClientTestCase>();
            testCase2 = A.Fake <IMockRapidHttpClientTestCase>();
            testCase3 = A.Fake <IMockRapidHttpClientTestCase>();

            client = new MockRapidHttpClient();
        }
        public HubSpotOwnerClientFunctionalTest(ITestOutputHelper output)
            : base(output)
        {
            var mockHttpClient = new MockRapidHttpClient()
                                 .AddTestCase(new GetOwnerMockTestCase())
                                 .AddTestCase(new GetOwnerByIdNotFoundMockTestCase())
                                 .AddTestCase(new ListOwnerMockTestCase());

            _client = new HubSpotOwnerClient(
                mockHttpClient,
                Logger,
                new RequestSerializer(new RequestDataConverter(LoggerFactory.CreateLogger <RequestDataConverter>())),
                "https://api.hubapi.com/",
                "HapiKeyFisk"
                );
        }
예제 #4
0
        public HubSpotAssociationClientFunctionalTest(ITestOutputHelper output)
            : base(output)
        {
            var mockHttpClient = new MockRapidHttpClient()
                                 .AddTestCase(new CreateAssociationMockTestCase())
                                 .AddTestCase(new CreateBatchAssociationMockTestCase())
                                 .AddTestCase(new DeleteAssociationMockTestCase())
                                 .AddTestCase(new DeleteBatchAssociationMockTestCase())
                                 .AddTestCase(new ListAssociationMockTestCase());

            _client = new HubSpotAssociationsClient(
                mockHttpClient,
                Logger,
                new RequestSerializer(new RequestDataConverter(LoggerFactory.CreateLogger <RequestDataConverter>())),
                "https://api.hubapi.com/",
                "HapiKeyFisk"
                );
        }
예제 #5
0
        public HubSpotCompanyClientFunctionalTest(ITestOutputHelper output)
            : base(output)
        {
            var mockHttpClient = new MockRapidHttpClient()
                                 .AddTestCase(new CreateCompanyMockTestCase())
                                 .AddTestCase(new GetCompanyMockTestCase())
                                 .AddTestCase(new GetCompanyByIdNotFoundMockTestCase())
                                 .AddTestCase(new UpdateCompanyMockTestCase())
                                 .AddTestCase(new DeleteCompanyMockTestCase())
                                 .AddTestCase(new SearchByDomainMockTestCase());

            _client = new HubSpotCompanyClient(
                mockHttpClient,
                Logger,
                new RequestSerializer(new RequestDataConverter(LoggerFactory.CreateLogger <RequestDataConverter>())),
                "https://api.hubapi.com/",
                "HapiKeyFisk"
                );
        }