Unit Testing controller (net core) #1192
Unanswered
rafaelvetronetrimb
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm injecting IFeatureHubConfig in my controller. Then I do like:
var featureFlagContext = await _featureHubConfig.NewContext().Attr("cid", cid).Build(); var filterOrgUnits = featureFlagContext["enableFilterUserOrgUnits"].IsEnabled;
In my unit tests, the auto-mock (XUnit2) always evaluates to true.
How can I mock the featureHubConfig to return a mocked IClientContext with my configuration values?
Beta Was this translation helpful? Give feedback.
All reactions