Class HttpContextSource
A unit testable alternative to HttpContext.Current.
Inheritance
System.Object
HttpContextSource
Namespace: DotNetNuke.Common
Assembly: DotNetNuke.dll
Syntax
public class HttpContextSource : object
Properties
| Improve this Doc View SourceCurrent
Gets the current HttpContext.
Declaration
public static HttpContextBase Current { get; }
Property Value
| Type | Description |
|---|---|
| HttpContextBase |
Methods
| Improve this Doc View SourceRegisterInstance(HttpContextBase)
Injects a fake/mock context for unit testing.
Declaration
public static void RegisterInstance(HttpContextBase instance)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContextBase | instance | The fake context to inject. |