-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FormRecognizer] Samples test fix (#11728)
* Created FRLiveTestBase * Make previously ignored tests work (samples)
- Loading branch information
Showing
8 changed files
with
92 additions
and
48 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
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
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
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
34 changes: 34 additions & 0 deletions
34
...formrecognizer/Azure.AI.FormRecognizer/tests/Infrastructure/FormRecognizerLiveTestBase.cs
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Azure.AI.FormRecognizer.Training; | ||
using Azure.Core.TestFramework; | ||
|
||
namespace Azure.AI.FormRecognizer.Tests | ||
{ | ||
public class FormRecognizerLiveTestBase : RecordedTestBase<FormRecognizerTestEnvironment> | ||
{ | ||
public FormRecognizerLiveTestBase(bool isAsync) : base(isAsync) | ||
{ | ||
Sanitizer = new FormRecognizerRecordedTestSanitizer(); | ||
Matcher = new FormRecognizerRecordMatcher(); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a <see cref="FormTrainingClient" /> with the endpoint and API key provided via environment | ||
/// variables and instruments it to make use of the Azure Core Test Framework functionalities. | ||
/// </summary> | ||
/// <returns>The instrumented <see cref="FormTrainingClient" />.</returns> | ||
protected FormTrainingClient CreateInstrumentedFormTrainingClient() | ||
{ | ||
var endpoint = new Uri(TestEnvironment.Endpoint); | ||
var credential = new AzureKeyCredential(TestEnvironment.ApiKey); | ||
|
||
var options = Recording.InstrumentClientOptions(new FormRecognizerClientOptions()); | ||
var client = new FormTrainingClient(endpoint, credential, options); | ||
|
||
return InstrumentClient(client); | ||
} | ||
} | ||
} |
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
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
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