Skip to content

Commit

Permalink
[FormRecognizer] Fix failing tests (#14240)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinelski authored Aug 14, 2020
1 parent 6ae2cad commit c3062e7
Show file tree
Hide file tree
Showing 6 changed files with 1,047 additions and 1,260 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,9 @@ public async Task StartRecognizeCustomFormsWithoutLabelsCanParseMultipageForm(bo

// Basic sanity test to make sure pages are ordered correctly.

var sampleField = recognizedForm.Fields["field-2"];
var expectedLabelData = formIndex == 0 ? "__Tokens__1" : "Contact:";
var expectedValueData = formIndex == 0 ? "Vendor Registration" : "[email protected]";
var sampleField = recognizedForm.Fields["field-1"];
var expectedLabelData = formIndex == 0 ? "__Address__1" : "Company Name:";
var expectedValueData = formIndex == 0 ? "Contoso Ltd. 2345 Dogwood Lane Birch, Kansas 98123" : "Southridge Video";

Assert.IsNotNull(sampleField.LabelData);
Assert.AreEqual(expectedLabelData, sampleField.LabelData.Text);
Expand Down Expand Up @@ -1185,8 +1185,8 @@ public async Task StartRecognizeCustomFormsThrowsForDamagedFile(bool useTraining
var operation = await client.StartRecognizeCustomFormsAsync(trainedModel.ModelId, stream);

RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(async () => await operation.WaitForCompletionAsync(PollingInterval));
string expectedErrorCode = useTrainingLabels ? "3014" : "2005";
Assert.AreEqual(expectedErrorCode, ex.ErrorCode);

Assert.AreEqual("2005", ex.ErrorCode);

Assert.True(operation.HasCompleted);
Assert.False(operation.HasValue);
Expand Down
Loading

0 comments on commit c3062e7

Please sign in to comment.