title: How to pass a POCO class to .NET Core configuration
body: <p>I am working on integration tests of .NET Core application and want to use some test configuration. My configuration is a POCO class that is configured via <code>appsettings.json</code> and then consumed via <code>IOptions&lt;T&gt;</code>. In my tests I'd like to use an instance of that class.</p>
  
  <p>Here is the code: </p>
  
  <pre><code> var mySettings = GetTestSettings(); // factory method returning POCO class 
   var configurationBuilder = new ConfigurationBuilder();
  
   // I am looking for something like 
   configurationBuilder.AddInMemoryObject("Settings", mySettings);
  
   // does not work, result is just string 
   configurationBuilder.AddInMemoryCollection("Settings",
          JsonConvert.SerializeObject(mySettings)); 
  
  // requires filename
  configurationBuilder.AddJsonFile("filename.json");
  </code></pre>
  
  <p>What is the easiest way to feed POCO to configuration?</p>