I have looked into this at one time, although my scenario was different; I needed the HTTP Context to do some server-side mapping.
I ended up admitting defeat and wrapped the .Net framework functionality I needed in a class, and then used Rhino-Mocks to mock it. Unfortunately in your situation that doesn't prove that .Net will get your resources correctly. At the same time, it's considered unnecessary to write unit-tests over the .Net framework itself; at some stage an assumption must be made. I did stumble upon a HTTP Simulator, but I have no idea how good it is: http://haacked.com/archive/2007/06/19/unit-tests-web-code-without-a-web-server-using-httpsimulator.aspx There is a HTTP Simulator that you can use in conjunction with your unit-test On Sun, Sep 12, 2010 at 10:11 AM, silky <[email protected]> wrote: > On Fri, Sep 10, 2010 at 11:45 PM, Wallace Turner <[email protected]> > wrote: > > *this is just a though* > > > > Are you testing HttpContext.Current.GetGlobalResource( ) itself or the > code > > up until that point? > > > > If the latter then could you replace all your GetGlobalResource( ) calls > > with your own static method? You could then use IoC to plugin in either > the > > real GetGlobalResource or your own GetResource( ) > > FWIW, this is probably what I'll need to go with. Here is a similar > article on the matter: > > > http://weblogs.asp.net/dwahlin/archive/2009/01/20/custom-asp-net-server-controls-and-language-localization.aspx > > > > Wal > > -- > silky > > http://dnoondt.wordpress.com/ > > "Every morning when I wake up, I experience an exquisite joy — the joy > of being this signature." >
