title: Mvcontrib.MVC3.Testhelper UpdateModel NullReferenceExceuption during Unit Test
body: <p>I am trying to unit test an edit action on my controller in ASP.NET MVC 3.</p>
  
  <p>I have installed Mvcontrib.MVC3.TestHelper via nuget to mock out my controller Context but I am still getting a NullReferenceException</p>
  
  <p>my code looks like this:</p>
  
  <pre><code> [TestMethod]
      public void it_should_redirect_to_index_after_editing_a_something_successfully()
      {
          var something= new SomeThing
          {
              ID = Guid.NewGuid(),
              CreatedAt = DateTime.Now,
              LastModified = DateTime.Now,
              Owner = "Me",
              Status = "new",
              Title = "my Title",
              Attachments = new List&lt;Attachment&gt;()
          };
  
          var repo = new FakeRepository();
          var controller = new SomethingsController(repo);
          new TestControllerBuilder().InitializeController(controller);
  
          var result = controller.Edit(something) as RedirectToRouteResult;
          result.AssertActionRedirect().ToAction&lt;SomethingsController&gt;(x =&gt; x.Index());
      }
  </code></pre>
  
  <p>Production code looks like this...</p>
  
  <pre><code> [HttpPost]
      public ActionResult Edit(SomeThing something)
      {
          if (ModelState.IsValid)
          {
              var _something = _repository.GetDocumentByID(something.ID);
              TryUpdateModel(_something);
              _something.LastModified = DateTime.Now;
              _repository.SaveChanges();
              return RedirectToAction("Index","Somethings");
          }
          return View(something);
      }
  </code></pre>
  
  <p>And even if I use UpdateModel or TryUpdateModel it alwas crashes with a NullReferenceException...</p>
  
  <p>Any help, pointers would be fantastic...</p>