public static void SetCurrentContext(string fileName, string url, string queryString, FakePrincipal principal) { var context = CreateHttpContext(fileName, url, queryString); context.User = principal; var result = RunInstanceMethod(Thread.CurrentThread, "GetIllogicalCallContext", new object[] { }); SetPrivateInstanceFieldValue(result, "m_HostContext", context); }
public static void SetCurrentContext(FakePrincipal principal) { SetCurrentContext("index.aspx", "http://tempuri.org/index.aspx", null, principal); }