Esempio n. 1
0
        internal static HttpContextBase GetContext(string url, string method, IPrincipal user)
        {
            var httpRequest = new SimpleHttpRequest
            {
                UriPath    = url,
                User       = user,
                HttpMethod = method
            };

            var worker      = new ActionRequestWrapper(httpRequest);
            var httpContext = new HttpContext(worker)
            {
                User = httpRequest.User ?? CreateAnonymousUser()
            };

            return(new HttpContextSimulator(httpContext));
        }
        internal static HttpContextBase GetContext(string url, string method, IPrincipal user)
        {
            var httpRequest = new SimpleHttpRequest
            {
                UriPath = url,
                User = user,
                HttpMethod = method
            };

            var worker = new ActionRequestWrapper(httpRequest);
            var httpContext = new HttpContext(worker)
            {
                User = httpRequest.User ?? CreateAnonymousUser()
            };

            return new HttpContextSimulator(httpContext);
        }