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

[FEATURE REQ] Enhance MockableTrafficManagerArmClient Usability for Unit Testing by Adding Setters to TrafficManagerRegion Properties #44435

Closed
chensy96 opened this issue Jun 7, 2024 · 4 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team Network - Traffic Manager question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@chensy96
Copy link

chensy96 commented Jun 7, 2024

Library name

Azure.ResourceManager.DataFactory.Mocking

Please describe the feature.

When trying to write the unit test using 'MockableTrafficManagerArmClient.GetTrafficManagerGeographicHierarchyResource' method, and to get 'TrafficManagerGeographicHierarchyData' as the result (which is required in the method we need to test as a parameter) we ran into a dead end:

  • When mocking, the data is empty, but we need such a hierarchy object
  • We also can not create an instance of this object and give it customized values, because the missing setter in the list of 'TrafficManagerRegion'

Would there be a better way of approaching this issue? or could you add the setter?

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team Network - Traffic Manager question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 7, 2024
Copy link

github-actions bot commented Jun 7, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@ArthurMa1978
Copy link
Member

Hey @chensy96 , thank you for reaching out to us, I guess your question is about Azure.ResourceMananger.TrafficManager.
For you question:

  1. You need to fill in all data if you want to mock a class.
  2. You meant this TrafficManagerGeoGraphicHierarchyData.TrafficManagerRegion ? It's not a collection. If a property is a collection, then there is no setter because you can use collection's add/update/delete methods to update the property, instead of assign a new collection.

@ArthurMa1978 ArthurMa1978 added the needs-author-feedback More information is needed from author to address the issue. label Jun 11, 2024
Copy link

Hi @chensy96. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@github-actions github-actions bot removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Jun 11, 2024
@chensy96
Copy link
Author

Hey @chensy96 , thank you for reaching out to us, I guess your question is about Azure.ResourceMananger.TrafficManager. For you question:

  1. You need to fill in all data if you want to mock a class.
  2. You meant this TrafficManagerGeoGraphicHierarchyData.TrafficManagerRegion ? It's not a collection. If a property is a collection, then there is no setter because you can use collection's add/update/delete methods to update the property, instead of assign a new collection.

Thank you that actually solved the problem. I was not familiar with the collection object.

@github-actions github-actions bot added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team Network - Traffic Manager question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

2 participants