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( )
Yeah, I had considered this. The problem is, (well, one could argue how much of a problem it is) is that not all calls to get resources are done via me directly calling HttpContext.GetGlobalResource ... (you can use the meta:ResourceKey approach on asp.net controls themselves to have various properties set). Now, it so happens that the particular code I want to test *does* directly call GetGlobal... so I could replace it in the IoC manner you describe. But I am kind of not overjoyed by that because it's not the "One True" way to get the resources. Ideally, I'd create a new HttpContext and direct it to the location of the resources. I'm still looking into doing this (it may or may not be possible). If it's not possible, I'll probably fall back to your method. Thanks for the comments. > Wal -- silky http://dnoondt.wordpress.com/ "Every morning when I wake up, I experience an exquisite joy — the joy of being this signature."
