title: How to read .runsettings test parameter in xUnit fixture
body: <p>I'm writing <strong>xUnit</strong> unit test cases for a <em>dotnet core</em> application which uses <em>DocumentDB (CosmosDB)</em> as storage. The unit test are written to execute against the <em>local cosmos db emulator</em>. On the Azure DevOps build environment, I've setup the <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/tutorial-setup-ci-cd" rel="noreferrer">Azure Cosmos DB CI/CD task</a> which internally creates a container to install the emulator. However, I'm not able to figure out that how the endpoint of emulator can be passed to xUnit fixture?</p>
  
  <p>Is there any way through which xUnit fixture can read the .runsettings test parameters or parameters can be passed via other source?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Currently, I implemented the scenario using Environment Variable but still not happy to define the connection string as a environment variable using powershell in build task and read it in through code during unit test execution. I was thinking if there could be another way of achieving it..</p>
  
  <p>Below snapshot shows how the build tasks are configured currently as workaround to achieve the desired:
  <a href="https://i.stack.imgur.com/hglPD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hglPD.png" alt="enter image description here"></a></p>
  
  <p>And code to read the value as</p>
  
  <pre><code>var serviceEndpoint = Environment.GetEnvironmentVariable("CosmosDbEmulatorEndpointEnvironmentVariable");
  </code></pre>
  
  <p>Since, UnitTest task provides the option to pass .runsettings/.testsettings with option to override the test run parameters so was thinking it something can be achieved using those options.</p>