public void Should_correct_set_take_and_skip_filter_when_take_is_empty()
        {
            var filter = new DocflowFilter();

            filter.SetSkip(Skip);
            ShouldHaveExpectedQueryParameters(
                filter,
                (nameOfSkip, Skip.ToString()));
        }
        public void Should_correct_set_take_and_skip_filter_when_skip_is_null()
        {
            var filter = new DocflowFilter();

            filter.SetSkip(null);
            filter.SetTake(Take);
            ShouldHaveExpectedQueryParameters(
                filter,
                (nameOfTake, Take.ToString()));
        }
        public void FailToGetDocflows_WithBadParameters()
        {
            var badFilter = new DocflowFilter
            {
                Take   = 1,
                InnKpp = "wrong innKpp"
            };

            Assert.ThrowsAsync <HttpRequestException>(async() => await Client.Docflows.GetDocflowsAsync(Account.Id, badFilter));
            Assert.ThrowsAsync <HttpRequestException>(async() => await Client.Docflows.GetDocflowsAsync(badId));
        }
 public async Task <DocflowPage> GetAllInventoryDocflowsAsync(
     Guid accountId,
     Guid relatedDocflowId,
     Guid relatedDocumentId,
     DocflowFilter filter = null,
     TimeSpan?timeout     = null) =>
 await client.SendRequestAsync <DocflowPage>(
     HttpMethod.Get,
     $"/v1/{accountId}/docflows/{relatedDocflowId}/documents/{relatedDocumentId}/inventories",
     filter?.ConvertToQueryParameters(),
     timeout : timeout);
        public void Should_correct_set_take_and_skip_filter_when_skip_take_the_same()
        {
            var take   = Skip;
            var filter = new DocflowFilter();

            filter.SetSkip(Skip);
            filter.SetTake(take);
            ShouldHaveExpectedQueryParameters(
                filter,
                (nameOfSkip, Skip.ToString()),
                (nameOfTake, take.ToString()));
        }
 private static void ShouldHaveExpectedQueryParameters(DocflowFilter docflowFilter, params (string name, string value)[] expectedQueryParameters)
Beispiel #7
0
 public async Task <DocflowPage> GetDocflowsAsync(Guid accountId, DocflowFilter filter = null, TimeSpan?timeout = null) =>
 await client.SendRequestAsync <DocflowPage>(
     HttpMethod.Get,
     $"/v1/{accountId}/docflows",
     filter?.ConvertToQueryParameters(),
     timeout : timeout);