I have a little alternative MVC framework built atop ASP.Net(though not strictly tied to it). One of the things I mess around with a whole lot is HttpContext
instances and HttpContext.Current
. Recently, I've went to trying to put in a few unit tests for my framework and found that HttpContext is notoriously hard to test against. Because my application isn't necessarily tied to ASP.Net, I've tried reimplementing a more basic version of HttpContext, HttpRequest, and friends, but this is a massive undertaking for the shear amount of information that must be contained in these classes.
What exactly should I do? Find a work around for testing with HttpContext or restructure my code to not explicitly depend on it so much? Or is there a better way? Is using HttpContext directly a lot a bad thing?