Closed brian-knoll-micronetonline closed 3 months ago
Hey @brian-knoll-micronetonline,
Seems like an oversight as this project seems to use interfaces in plenty of places already
It's not an oversight, it was a deliberate design choice to make the result type of IConfigCatClient.Snapshot()
a value type, for performance considerations (to avoid heap memory allocation).
The ConfigCatClientSnapshot
type, however, provides a constructor that takes an IConfigCatClientSnapshot
object as its parameter. This should allow you to provide a fake implementation for testing purposes.
Does this work for you? If not, what difficulties do you experience exactly with your tests?
That works for my use case thank you
Is your feature request related to a problem? Please describe.
I am having increased difficulty testing my code that uses IConfigCatClient.Snapshot()
Describe the solution you'd like
Change
IConfigCatClient.Snapshot()
to returnIConfigCatClientSnapshot
Describe alternatives you've considered
Testing in a way that does not Moq the result of Snapshot
Additional context
Seems like an oversight as this project seems to use interfaces in plenty of places already