title: ASP.Net Core Integration Testing
body: <p>I'm struggling to get any sort of integration tests working with ASP.Net Core RC2.
  I have created a basic web project which runs fine in the browser showing the default page as expected. I then added a new class (in the same project) with the following test code:</p>
  
  <pre><code>[TestClass]
  public class HomeControllerTests
  {
      private HttpClient client;
  
      [TestInitialize]
      public void Initialize()
      {
          // Arrange
          var host = new WebHostBuilder()
             .UseEnvironment("Development")
             .UseKestrel()
             .UseContentRoot(Directory.GetCurrentDirectory())
             .UseIISIntegration()
             .UseStartup&lt;Startup&gt;();
  
          TestServer server = new TestServer(host);
  
          client = server.CreateClient();
      }
  
  
      [TestMethod]
      public async Task CheckHomeIndex()
      {
          string request = "/";
  
          var response = await client.GetAsync(request);
  
          response.EnsureSuccessStatusCode();
  
          Assert.IsTrue(true);
      }
  }
  </code></pre>
  
  <p>The test does not pass, with the following exception:</p>
  
  <blockquote>
    <p>The view 'Index' was not found. The following locations were searched:<br>
    /Views/Home/Index.cshtml<br>
    /Views/Shared/Index.cshtml</p>
  </blockquote>
  
  <p>I'm using MSTest as opposed to xUnit at this stage. Changing the ContentRoot to that suggested in the "duplicate" question unfortunately does not resolve the issue.</p>
  
  <p>Has anyone got integration tests working? I've tried tweaking the <code>WebHostBuilder</code> settings but with no luck. </p>