Using ASP.NET Core's ConfigurationBuilder in a Test Project
<p>I want to use the <code>IHostingEnvironment</code> and <code>ConfigurationBuilder</code> in my functional test project, so that depending on the environment the functional tests run using a different set of configuration. I want to make use of the code below:</p>

<pre><code>public IConfigurationRoot ConfigureConfiguration(IHostingEnvironment hostingEnvironment)
{
    var builder = new ConfigurationBuilder()
        .AddJsonFile("appsettings.json")
        .AddJsonFile($"appsettings.{hostingEnvironment.EnvironmentName}.json", true)
        .AddEnvironmentVariables();
    return builder.Build();
}
</code></pre>

<p>I want to have an <code>appSettings.json</code> and <code>appSettings.Production.json</code> file to point my functional tests at production. Is this possible? How can it be achieved? I would need an instance of <code>IHostingEnvironment</code>.</p>