Good ol’ HttpContext in ASP.Net.
HttpContext has no base class and isn’t virtual, thus, is unusable for testing and unmockable. Strongly recommended to not pass it around as arguments. Instead, pass around variables of type
New to C# 3.5 and meant to replace
HttpContextBase is abstract, thus, it is now mockable. Concretely implemented by
Also new in C# 3.5 – this is the concrete implementation of
HttpContextBase. To instantiate in a normal webpage:
var webContext = new HttpContextWrapper(HttpContext.Current)
The whole idea is to make your code test-able by allowing your test framework to mock the
More detail explanation on here.