Open mingqishao opened 1 year ago
@mingqishao If the fake
package allows the creation of the Transport
then it should be also available for azcosmos.
The Options on client creation let you set the Transport
.
Just saw that the fakes
is only available for ARM Compute. I wonder if this needs to be created for all SDKs?
@jhendrixMSFT Are there any other recommendations for external users to mock the transport or the SDKs?
I found a internal package in SDK github.com/Azure/azure-sdk-for-go/sdk/internal/mock
. That will be very useful for us if you can expose this package. That allow use to easily mock any service's client.
I don't want mocks. I want stubs for CosmosDb SDK Fake implementations like the other MS team did:
or remove sealed keywords so we can make these fakes/stub by over selves.
Feature Request
We are using azcosmos package to talk with CosmosDB. We are struggling with mock the cosmos client for unit test. I'm wonder if the azcosmos SDK could provide a easy way to mock.
I found a usefully example from Compute SDK as reference: https://github.com/Azure/azure-sdk-for-go/blob/fake_prototype/sdk/resourcemanager/compute/armcompute/README.md#fakes