Hi John,
Looks like a good candidate for dependency injection, there are a few ways to approach it. Here is one straightforward way, YMMV.
1. Make your ApplicationContext class into an regular non-static class
2. Extract the IApplicationContext interface
3. Update anything that uses ApplicationContext to accept an IApplicationContext in its constructor instead
4. Simplify the ApplicationContext class into HttpApplicationContext (remove the thread-local stuff)
5. Register HttpApplicationContext as the provider of IApplicationContext in your real application
6. Consider creating a stubbed implementation of IApplicationContext to use in your unit tests (or use a mocking library such as Moq)
I suspect step 5 is where things are going to get tough. If you're not already using dependency injection and a DI container, there's probably a lot to consider right about here. The likely result is that any classes using IApplicationContext will themselves end up being created through the container.
Check out:
http://code.google.com/p/autofac/wiki/ExistingApplicationshttp://kohari.org/2008/06/20/applying-ioc-to-brownfield-projects/
http://tech.groups.yahoo.com/group/altdotnet/message/10434...for some discussion and advice.
Hope this helps,
Nick