Accessing HttpContext.Request members throws exception

Oct 5, 2011 at 6:29 PM

During the course of a rendering a view, a helper method  I use for rendering partial views (it's purpose is to output errors in debug and suppresses, but records, them in release), throws an exception when we render the view using RazorGenerator. 

I traced through the code and found that most of the members in faked HttpRequest object throw a NotImplementedException when accessed.

Is there an extension point where I could pass in my own faked/mocked httpContext objects?

Ideally if the library was going to provide its own, it should do so with expectation that these members will be accessed and should return a safe default value an not throw an exception.

Oct 5, 2011 at 10:15 PM

Created fork with a possible fix