.NET Core configuration allows so many options to add values (environment variables, json files, command line args).
I just can\'t figure out and find an answer how
You can use the following technique to mock IConfiguration.GetValue
extension method.
var configuration = new Mock();
var configSection = new Mock();
configSection.Setup(x => x.Value).Returns("fake value");
configuration.Setup(x => x.GetSection("MySection")).Returns(configSection.Object);
//OR
configuration.Setup(x => x.GetSection("MySection:Value")).Returns(configSection.Object);