title: xunit read application appsetting file not its own in .net core
body: <p>I have a test solution with this configuration as you can see :</p>
  <pre><code> public class TestHostBuilder : RavenTestDriver, IDisposable
      {
  
      public IHost host = null;
      public IConfiguration Configuration;
      public IDocumentStore documentStore = null;
      public TestHostBuilder()
      {
          ConfigureServer(new TestServerOptions() {FrameworkVersion = null,});
          documentStore = GetDocumentStore();
          Environment.SetEnvironmentVariable(&quot;TEST_ENV&quot;, &quot;on&quot;);
          var hostBuilder = easy.api.Program.CreateHostBuilder(new string[0])
      .ConfigureWebHost(webHostBuilder =&gt;
      {
          webHostBuilder.UseTestServer();
      }).ConfigureAppConfiguration(config =&gt;
      {
          //config.Configure&lt;domain.Environments.RavenOptions&gt;(configuration.GetSection(domain.Environments.RavenOptions.DefaultSectionName));
  
          config.AddJsonFile(&quot;appSettingTest.json&quot;, optional: true);
          Configuration=config.Build();
      })
     .ConfigureServices(services =&gt;
     {
        
         services.Configure&lt;IOptions&lt;domain.Environments.RavenOptions&gt;&gt;(options =&gt; Configuration.GetSection(&quot;RavenOptions&quot;).Bind(options));
         var q = services.BuildServiceProvider().GetRequiredService&lt;IOptions&lt;domain.Environments.RavenOptions&gt;&gt;().Value;
  
         services.AddScoped&lt;ICurrentUserService, InitRequest&gt;();
         services.AddScoped&lt;ICacheStorage&gt;(provider =&gt;
         {
             return new Mock&lt;ICacheStorage&gt;().Object;
         });
         services.AddRavenDbAsyncSession(GetDocumentStore(new GetDocumentStoreOptions()));
         services.AddTransient&lt;IAsyncDocumentSession&gt;((c) =&gt;
          {
              return documentStore.OpenAsyncSession();
          });
  
     });
  
          host = hostBuilder.Start();
  
      }
  }
  </code></pre>
  <p>As you can see I added the <code>appSettingTest</code> file into my test project but when I run the test and put a break point on <code>q</code> variable, the value of that is not the content of <code>appSettingTest</code>,it is the content of <code>appSetting</code>  in my application .why ?</p>