I want to write some UT for my code
which uses HttpContext.Current
How can I fake this object?
Check out the WatiN library and tools. You can fake a IE thread.
I am using Phil Haack HttpSimulator for that purpose :
You could use a commercial tool like Typemock Isolator to fake the HttpContext directly, without wrapping it in your own code:
Isolate.WhenCalled(()=> controller.HttpContext.Current.Session["UserID"]) .WillReturn("YourID");
If you own that code, don't use HttpContext directly. Use some interface that abstract HttpContext away. Then replace the implementation of that interface in unit tests.