Creating Mock with Moq around existing instance?
stackoverflow.com › questions › 59660284Jan 9, 2020 · var config = MyTestContainer.Resolve<IConfiguration> (); //let's say that config.UseFeatureX = false; //here, I'd like to create mock "around" the existing instance: var mockedConfig = Mock.CreateWith (config); //CreateWith => a method I'd like to find how to do mockedConfig.Setup (c => c.UseFeatureX).Returns (true); How to do this wrapping ...