title: How run C# Unit tests in docker container
body: <p>i Have problem with run Unit tests in docker container.
  I'm create ApiTests project with Nunit tests for custom class methods. Tests successfully run.
  Then create UnitApiTestsService project which use ApiTests.dll like:</p>
  
  <pre><code>var dockerEnvironment = Environment.GetEnvironmentVariable("DOCKER_UNIT_TEST_ENVIRONMENT")=="TRUE" ? true : false;
  var info = new ProcessStartInfo
  {
      FileName = "dotnet",                       
      Arguments = dockerEnvironment ? "vstest ApiTests.dll" : "vstest ../ApiTests/bin/Debug/netcoreapp2.2/ApiTests.dll",
      UseShellExecute = false,
      RedirectStandardOutput = true
  };
  _shedulerProcess = Process.Start(info);
  var testResults = _shedulerProcess.StandardOutput.ReadToEnd();
  _shedulerProcess.WaitForExit();
  </code></pre>
  
  <p>dockerEnvironment is true</p>
  
  <p>Service runned by message from RabbitMQ. 
  Locally(when i run project in me IDE) all succesfully work, but when i put UnitApiTestsService in docker image, after start this image i have same throuble on line Process.Start(info); with this text:</p>
  
  <pre><code>vstest.console process failed to connect to testhost process after 10000 seconds. This may occur due to machine slowness, please set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout. Test Run Aborted.
  </code></pre>
  
  <p>my Dockerfile:</p>
  
  <pre><code>#FROM microsoft/dotnet:2.2-sdk AS build-env
  FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
  
  WORKDIR /app
  COPY . .
  RUN dotnet publish ./Operations/ApiTests -c Release -o publish
  RUN dotnet publish ./Operations/UnitAPITestsService -c Release -o publish
  
  WORKDIR /app/Operations/ApiTests/
  RUN dotnet restore .; exit 0;
  RUN dotnet build
  
  # Build runtime image
  #FROM microsoft/dotnet:2.2-sdk
  FROM mcr.microsoft.com/dotnet/core/sdk:2.2
  #FROM mcr.microsoft.com/dotnet/core/aspnet:2.2  
  
  WORKDIR /app
  COPY --from=build-env /app/Operations/UnitAPITestsService/publish .
  ENTRYPOINT ["dotnet", "UnitAPITestsService.dll"]
  
  RUN mkdir -p /opt/
  RUN chmod -R 777 /opt/
  RUN mkdir -p /opt/download
  RUN chmod -R 777 /opt/download
  ENV VSTEST_CONNECTION_TIMEOUT 10000
  ENV DOCKER_UNIT_TEST_ENVIRONMENT TRUE
  </code></pre>
  
  <p>when container work, service successfully receive message from Rabbit.
  anybody might solve this trouble?</p>