title: Create Unit Test for MVC 5 Controller with Owin
body: <p>I am trying to create a unit test to run with the controllers that are included in the .NET template project for the MVC 5 in Visual Studio 2013 using Framework 4.5.1.</p>
  
  <p>This was suppose to test the ManageController class included in the project for standard user login.</p>
  
  <p>Here is the code I am using to call the Index action of the controller (remember that the "Index" action is the default one):</p>
  
  <pre><code>[TestClass]
  public class ManageControllerTests {
      [TestMethod]
      public async Task ManageController_Index_ShoudlPass() {
          using (var server = TestServer.Create&lt;Startup&gt;()) {
              var response = await server.HttpClient.GetAsync("/Manage");
              Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
          }
      }
  }
  </code></pre>
  
  <p>The test does not fail but the response is a 404.
  And if I try to debug the process does not seems to hit the Index method in the controller or event the controller constructor.</p>
  
  <p>I've added the "Microsoft.Owin.Testing" package via NuGet. And the Configuration method in the Startup class of the application is being called correctly.</p>
  
  <p>What am I missing? I could not find a clear example in the web to implement that test.
  Can some one put here a step by step on how to test that controller?</p>
  
  <p>Thanks</p>