-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FormRecognizer] Fix failing tests (#14240)
- Loading branch information
Showing
6 changed files
with
1,047 additions
and
1,260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
|
@@ -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); | ||
|
Oops, something went wrong.