title: Xunit initialize issues
body: <p>I am having some issues to properly initialize my db adaptor class in my unit test case where the constructor of my dbadaptor class also initialize a vault to connect
  and fetch our connection string</p>
  <p>Below is the adaptor class that connects to our db</p>
  <pre><code>public class DBAdapterService : IDBAdapterService
  {
      private readonly AppSettings _settings;
      private IVaultService _vaultService;
      public DBAdapterService(IOptions&lt;AppSettings&gt; settings, IVaultService vaultService)
      {
          _settings = settings?.Value;        
          _vaultService = vaultService;
      }
      
      public void Retrieve(string command)
      {
        //call configure of vault to get credentials
          using (var conn = new SnowflakeDbConnection())
          {           
              //open connection using above connection string
              //execute command
          }    
      }
  }
  </code></pre>
  <p>Below class connects to our vault and dynamically gets our connection string</p>
  <pre><code>public class VaultService : IVaultService
  {
      public VaultService()
      {
          //some initialization
      }
      
      public async Task&lt;Credentials&gt; Configure()
      {
        //code to connect to vault and get credentials
      
         return vaultCredentials;
      }
  }
  </code></pre>
  <p>//Xunit Test using Moq</p>
  <pre><code>[Fact]
  public async Task get_data()
  {
      Mock&lt;IOptions&lt;AppSettings&gt;&gt; appsettingMock = new Mock&lt;IOptions&lt;AppSettings&gt;&gt;();
              appsettingMock.Setup(i =&gt; i.Value).Returns(new AppSettings
              {
                 //settings some appsettings here
              });
      Mock&lt;IVaultService&gt; mockVault = new Mock&lt;IVaultService&gt;();
      
      //Is below the correct way to set vault as this doesnt seems to work
      IDBAdapterService dbadapterService = new DBAdapterService(appsettingMock.Object, mockVault.Object);
   
      //futher code to get data from db
  }   
  </code></pre>
  <p>When I run my above unit test I get error as &quot;object reference not set to instance error&quot;, thats because my connection string is not fetched and set proprly from vault</p>
  <p>So if anyone can provide inputs to how can I properly initialize my vault and pass to my dbadaptor class.</p>
  <p>I tried to put just the code relevant to the post so many other things might be missing.</p>