示例#1
0
        public async Task SubmitReviewAsync_ShouldSucceed()
        {
            // Arrange
            var submission = await _dataHelper.Submissions().GetAnyAsync();

            var result = await _submissionResultAwaiter.WaitReady(submission.Id);

            var changes = (JObject)result["results"]["document"]["results"];

            // Act
            var submitReviewJobId = await _reviewsClient.SubmitReviewAsync(submission.Id, changes);

            var jobResult = await _jobAwaiter.WaitReadyAsync <JObject>(submitReviewJobId, TimeSpan.FromSeconds(1));

            // Assert
            jobResult.Should().NotBeNull();
            jobResult.Value <string>("submission_status").Should().Be("pending_review");
            jobResult.Value <bool>("success").Should().Be(true);
        }
示例#2
0
        public async Task GetExtractionResult_ShouldReturnDocument(DocumentExtractionPreset preset)
        {
            // Arrange
            var jobId = await _ocrClient.ExtractDocumentAsync(_dataHelper.Files().GetSampleFilePath(), preset);

            var jobResult = await _jobAwaiter.WaitReadyAsync <ExtractionJobResult>(jobId, TimeSpan.FromMilliseconds(300));

            if (preset != DocumentExtractionPreset.OnDocument)
            {
                // Act
                var extractionResult = await _ocrClient.GetExtractionResultAsync(jobResult.Url);

                // Assert
                extractionResult.Should().NotBeNullOrEmpty();
            }
            else
            {
                // Act
                var extractionResult = await _ocrClient.GetExtractionResultAsync <JArray>(jobResult.Url);

                // Assert
                extractionResult.Count.Should().Be(1);
            }
        }