Skip to content

Instantly share code, notes, and snippets.

@johnw86
Created July 11, 2019 15:25
Show Gist options
  • Save johnw86/f71c6f0cca84a8f34e281ac8f657c77a to your computer and use it in GitHub Desktop.
Save johnw86/f71c6f0cca84a8f34e281ac8f657c77a to your computer and use it in GitHub Desktop.
Unit tests with IConfiguration
var myConfiguration = new Dictionary<string, string>
{
{"Age", "18"},
{"Nested:Property", "1"},
};
var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(myConfiguration)
.Build();
// Pass configuration in as IConfiguration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment