Update:
Based on a couple of the answers I have received, I just want to make clear that I am well aware how to go about mocking HttpContext using a moc
For testing I use Rhino.Mocks. To set up the HttpContext in the controller, I simply mocked it. So my system under test (or sut) is something like:
Controller controllerBase = sut as Controller;
I then mock out the controller context, and set up the context on the controller context to return the mock of the HttpContextBase class (as I mentioned above). My code looks something like:
controllerContext = AMockOf();
// Add the test HttpContextBase to the controller context
HttpContextBase httpContextBase = SetUpTestHttpContext();
WhenThe(controllerContext).IsAskedForIts(x =>x.HttpContext).Return(httpContextBase).Repeat.Any();
For other objects I sometimes use fakes as well.