title: Mocking HttpContext to retrieve item form contexts item dictionary
body: <p>We use MVC3, for our unit tests we use RhinoMocks in our unit tests.
  When the a request starts we check the domain from which it came and match that to a customer.
  This customer is stored in the HttpContext.Items.
  Most controllers need this info to do their thing.  </p>
  
  <pre><code>var mocks = new MockRepository();
  using (var controller = new TestController())
  {
      HttpContext context = 
          MockRepository.GenerateStub&lt;HttpContext&gt;();
  
      Customer customer = new Customer { Key = "testKey" };
      context.Items["Customer"] = customer;
  
      controller.ControllerContext = 
          new ControllerContext { 
              Controller = controller, 
              RequestContext = 
                  new RequestContext(
                      new HttpContextWrapper(context), 
                      new RouteData()
                      ) 
          };
         ...
  </code></pre>
  
  <p>This code sample shows basically what is needed, however the stub is not allowed as HttpContext is a "sealed" class.
  The controller accepts a HttpContextBase (there is lot about mocking this one), but it does not expose the Items property. </p>
  
  <p>Thoughts anyone? Or even better a solution ;-)</p>