Last post Dec 13, 2007 12:39 PM by Haacked
Dec 13, 2007 10:34 AM|PhilipRieck|LINK
In my MvcHandler, I'm now just overriding ProcessRequest in order to create the controller class by string name rather than by type. Since MvcHandler doesn't do much more than determine a controller type, instantiate it, and call it's execute method, I'd
actually like to forgo subclassing it completely.
Only my laziness is stopping me. In order to do that for this little project I'd have to implement IHttpContext. Now, don't get me wrong, I
love the fact it's an interface. makes testing easier (possible), etc. But outside of testing, everyone will basically be wrapping a real HttpContext every time.
So the request: since you've already written a HttpContext wrapper, perhaps you could expose it in the shipping bits, and allow us to create one given a HttpContext? The interface is a big one, and having everyone create their own - well, think of
all the collective keystrokes and testing time you'd be saving!
Dec 13, 2007 12:39 PM|Haacked|LINK
For unit testing, try using this technique to create your IHttpContext concrete instance:
As for making the html context wrapper public, we'll look into that. Thanks for the suggestion!