controllercontext

How do I Unit Test Actions without Mocking that use UpdateModel?

I have been working my way through Scott Guthrie's excellent post on ASP.NET MVC Beta 1. In it he shows the improvements made to the UpdateModel method and how they improve unit testing. I have recreated a similar project however anytime I run a UnitTest that contains a call to UpdateModel I receive an ArgumentNullException naming the ...

How do I stub the HttpSessionState in MVC RC1 with rhino mocks?

I'm trying to take advantage of the recent ControllerContext refactoring in asp.net mvc rc1. I should be able to stub the session rather simply but I keep getting a System.NullReferenceException on line 2 when running the following code: var mockContext = MockRepository.GenerateStub<ControllerContext>(); mockContext.Stub(x => x.HttpCont...

Controller equivalent of HttpContext.Current in ASP.NET MVC

I'd like to get access to the current executing Controller so I can offload the return of the appropriate ActionResult onto a helper method. To this end, I'm looking for the equivalent of what I would have thought would be ControllerContext.Current but isn't. Thanks! Edit for clarification: I've got a generic form control which is Jav...