-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FormRecognizer] Implement Model Factory for mocking support #14221
Conversation
sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormRecognizerModelFactory.cs
Show resolved
Hide resolved
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/Models/FormRecognizerModelFactoryTests.cs
Outdated
Show resolved
Hide resolved
sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormRecognizerModelFactory.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment related to separate the ModelFactory for Training (and having it in the Training namespace)
FYI @lenniebriscoe |
Many thanks for working on this. It will definitely improve testability. A few questions though.
|
Hello, @lenniebriscoe. Answering both of your questions: your approach is correct. That's how we designed mocking support in Azure SDK .NET libraries: service methods in clients/operations must be overridden, and model types can be instantiated by a static Model Factory. This is a guideline we follow in multiple libraries, so it's not likely to change soon. Feel free to reach out if you have more questions! |
Fixes #11529.