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

Define "unit-testability" rules for clients and data objects #5514

Closed
pakrym opened this issue Mar 19, 2019 · 0 comments
Closed

Define "unit-testability" rules for clients and data objects #5514

pakrym opened this issue Mar 19, 2019 · 0 comments
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.

Comments

@pakrym
Copy link
Contributor

pakrym commented Mar 19, 2019

Our client types should support being decorated/mocked by customers to be able to unit tests their code without running against a live service or having to wrap our type to make them unit-testable.

Couple things that come to mind:

  1. There should be a way for customer to avoid all network comunication
  2. Client methods should be virtual or available on an interface so they can be overriden
  3. Data objects should allow setting all properties (via protected setters or a different set of constructors) to allow simulating server responses

Another solution to this is to tell customers to replace the transport and simulate the services on HTTP level but this might be very complicated because it involves capturing real responses and dealing with protocol details.

Related issues:

Azure/azure-sdk#18

Azure/azure-storage-net#465

#3968
#6

https://github.com/Azure/azure-storage-net/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+mock

cc @maririos @KrzysztofCwalina @AlexGhiondea

@pakrym pakrym added Client This issue points to a problem in the data-plane of the library. Azure.Core labels Mar 19, 2019
@pakrym pakrym self-assigned this Apr 18, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

No branches or pull requests

2 participants