title: How to get appsettings in unit test project?
body: <p>I am able to inject appsettings in a class library. I have a proxy project I use to inject the appsettings then I can inject the proxy class everywhere. However, I can't figure out how to inject my proxy class in a unit test project.</p>
  
  <p><strong>Appsettings</strong></p>
  
  <pre><code>"ConnectionStrings": {
      "DefaultConnection": "Server=localhost\\SQLEXPRESS;Database=db;Trusted_Connection=True;"
    }
  </code></pre>
  
  <p><strong>Startup class</strong></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services
      .Configure&lt;EnvironmentSettings.EnvironmentSettings&gt;(Configuration)
      .AddSingleton(sp =&gt; sp.GetRequiredService&lt;IOptions&lt;EnvironmentSettings.EnvironmentSettings&gt;&gt;().Value);
  
      services.AddScoped&lt;Data.ISqlDataController, Data.SqlDataController&gt;();
  
      services.AddMvc();
  }
  </code></pre>
  
  <p><strong>EnvironmentSettings class (Proxy)</strong></p>
  
  <p>This class is in another class library project</p>
  
  <pre><code>public class EnvironmentSettings : IEnvironmentSettings
  {
      public ConnectionStrings ConnectionStrings { get; set; }
  }
  </code></pre>
  
  <p><strong>Here is the code that uses EnvironmentSettings</strong></p>
  
  <pre><code>public class SqlDataController : ISqlDataController
  {
      private EnvironmentSettings.EnvironmentSettings environmentSettings;
  
      public SqlDataController(EnvironmentSettings.EnvironmentSettings environmentSettings)
      {
          this.environmentSettings = environmentSettings;
      }
  
      public string Test()
      {
          return environmentSettings.ConnectionStrings.DefaultConnection;
      }
  }
  </code></pre>
  
  <p>As you can see I can inject EnvironmentSettings into SqlDataController. EnvironmentSettings is binded in the Startup class.</p>
  
  <p>So I can successfully inject the environmentsettings class in other classes and class libraries but how do I inject it into a unit test project. I don't want to use mocks in this case.</p>