title: Mocking User.Identity in ASP.NET MVC
body: <p>I need to create Unit Tests for an ASP.NET MVC 2.0 web site.   The site uses Windows Authentication.</p>
  
  <p>I've been reading up on the necessity to mock the HTTP context for code that deals with the HttpContext.  I feel like I'm starting to get a handle on the DI pattern as well.  (Give the class an attribute of type IRepository and then pass in a Repository object when you instantiate the controller.)   </p>
  
  <p>What I don't understand, however, is the proper way to Mock the Windows Principal object available through User.Identity. Is this part of the HttpContext?</p>
  
  <p>Does any body have a link to an article that demonstrates this (or a recommendation for a book)?   </p>
  
  <p>Thanks,</p>
  
  <p>Trey Carroll</p>