Пример #1
0
        public async Task Offset_is_correctly_added_to_queryString([Frozen] IHttpRestClient client, IHubSpotCrmAssociationClient sut, long objectId, int associationTypeId, long offset)
        {
            var response = await sut.GetAllAsync(objectId, associationTypeId, offset : offset);

            Mock.Get(client)
            .Verify(p => p.SendAsync <AssociationIdList>(HttpMethod.Get, $"/crm-associations/v1/associations/{objectId}/HUBSPOT_DEFINED/{associationTypeId}", QueryStringMatcher.That(Contains.Substring($"offset={offset}"))));
        }
Пример #2
0
        public async Task Request_is_correct([Frozen] IHttpRestClient client, IHubSpotCrmAssociationClient sut, long objectId, int associationTypeId)
        {
            var response = await sut.GetAllAsync(objectId, associationTypeId);

            Mock.Get(client)
            .Verify(p => p.SendAsync <AssociationIdList>(HttpMethod.Get, $"/crm-associations/v1/associations/{objectId}/HUBSPOT_DEFINED/{associationTypeId}", It.IsAny <IQueryString>()));
        }
Пример #3
0
        public async Task Limit_is_correctly_added_to_queryString([Frozen] IHttpRestClient client, IHubSpotCrmAssociationClient sut, long objectId, int associationTypeId, [System.ComponentModel.DataAnnotations.Range(1, 100)] int limit)
        {
            Assume.That(limit <= 100);

            var response = await sut.GetAllAsync(objectId, associationTypeId, limit);

            Mock.Get(client)
            .Verify(p => p.SendAsync <AssociationIdList>(HttpMethod.Get, $"/crm-associations/v1/associations/{objectId}/HUBSPOT_DEFINED/{associationTypeId}", QueryStringMatcher.That(Contains.Substring($"limit={limit}"))));
        }
Пример #4
0
 public void Limit_cant_be_greater_than_100(IHubSpotCrmAssociationClient sut, long objectId, int associationTypeId, int limit)
 {
     Assert.ThrowsAsync <ArgumentOutOfRangeException>(() => sut.GetAllAsync(objectId, associationTypeId, limit: 100 + limit));
 }