title: How write UnitTest for Web API Controller
body: <p>I am exploring CodeCamper project by JohnPapa on github
  <a href="https://github.com/johnpapa/CodeCamper" rel="nofollow">https://github.com/johnpapa/CodeCamper</a>. This is a ASP.Net SPA application and I am also working on similar project. </p>
  
  <p>I interested to write some UnitTests for WebAPI controller. Controller contractor requires UnitofWork instanse and UnitofWork is initiate in Application_Start method.</p>
  
  <p>When I run my UnitTest project UnitofWork object is null. How I can initiate UnitofWork from UnitTest project so that I can run my test methods. I hope make myself clear.</p>
  
  <p>Here is a sample UnitTest method for following controller.</p>
  
  <p><a href="https://github.com/johnpapa/CodeCamper/blob/master/CodeCamper.Web/Controllers/LookupsController.cs" rel="nofollow">LookupsController.cs</a></p>
  
  <p>UserControllerTest.cs</p>
  
  <pre><code>    [TestClass]
      public class UserControllerTest : ApiBaseController
      {
          [TestMethod]
          public void GetRoomsTest()
          {
              var controller = new LookupsController(Uow);
              var result = controller. GetRooms().Any();
              Assert.IsTrue(result);
          }
      }
  </code></pre>
  
  <p>Again why <strong>Uow</strong> is null? What should I do, so that I can write unit test methods for this type of project/architecture.</p>
  
  <p>For more detail about code you can check github repo.<a href="https://github.com/johnpapa/CodeCamper" rel="nofollow">https://github.com/johnpapa/CodeCamper</a></p>