Skip to content
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

[Test] Provide Model Factory per .NET Mocking Guidelines #11529

Closed
annelo-msft opened this issue Apr 23, 2020 · 1 comment · Fixed by #14221
Closed

[Test] Provide Model Factory per .NET Mocking Guidelines #11529

annelo-msft opened this issue Apr 23, 2020 · 1 comment · Fixed by #14221
Assignees
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer Cognitive Services

Comments

@annelo-msft
Copy link
Member

https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking

✅ DO provide factory or builder for constructing model graphs returned from virtual service methods.

Model types shouldn’t have public constructors. Instances of the model are typically returned from the client library, and are not constructed by the consumer of the library. Mock implementations need to create instances of model types. Implement a static class called ModelFactory in the same namespace as the model types.

@annelo-msft annelo-msft added Client This issue points to a problem in the data-plane of the library. Cognitive Services FormRecognizer labels Apr 23, 2020
@annelo-msft annelo-msft added this to the [2020] June milestone Apr 23, 2020
@annelo-msft annelo-msft changed the title Provide Model Factory per .NET Mocking Guidelines [Test] Provide Model Factory per .NET Mocking Guidelines May 7, 2020
@kinelski kinelski self-assigned this May 8, 2020
@annelo-msft annelo-msft modified the milestones: [2020] June, [2020] July May 14, 2020
@maririos
Copy link
Member

maririos commented Jun 9, 2020

FYI #12626

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer Cognitive Services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants