-
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
[QUERY] How to mock GetArmDeployments #30587
Comments
Mock of current version of mgmt. SDK is still in development phase, I'd suggest that instead of trying to mock extension method, a better way is put this extension method in a none-static method of your class than mock that none-static method |
Are there any updates on mocking the mgmt. SDK? |
Sorry for the delayed response, we already have an internal discussion about mocking extension methods and now I'm working on it. |
+1 to this issue. Would love to be able to mock out these static methods for Azure.ResourceManager.* packages. Is there any update on this @Yao725 ? |
Hi @Yao725, has this update been released? |
Hey sorry for the delay of response. This feature is actively tracking here: Azure/autorest.csharp#3493 |
Library name and version
Azure.ResourceManager.Resources 1.1.0
Query/Question
We're deploying an arm template using the Azure.ResourceManager packages, like so:
However, we're running into issues with unit testing this code, as GetArmDeployments() is a static method which cannot be mocked. Is there any guidance or documentation on how to work around this? I found a similar question here: #28861, and I'm wondering if there's a factory we need to use.
Environment
Windows 10 .NET 6.0
Visual Studio 17.3.0
The text was updated successfully, but these errors were encountered: