コード例 #1
0
        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);
        }
コード例 #2
0
 public static void SetCurrentContext(FakePrincipal principal)
 {
     SetCurrentContext("index.aspx", "http://tempuri.org/index.aspx", null, principal);
 }