public static HttpContextBase FakeHttpContext()
        {
            var context = new Mock<HttpContextBase>();
            var request = new Mock<HttpRequestBase>();
            var response = new Mock<HttpResponseBase>();
            var session = new Mock<HttpSessionStateBase>();
            var server = new Mock<HttpServerUtilityBase>();
            var user = new MockPrincipal();

            context.SetupGet(ctx => ctx.Request).Returns(request.Object);
            context.SetupGet(ctx => ctx.Response).Returns(response.Object);
            context.SetupGet(ctx => ctx.Session).Returns(session.Object);
            context.SetupGet(ctx => ctx.Server).Returns(server.Object);
            context.SetupGet(ctx => ctx.User).Returns(user);

            return context.Object;
        }
        public static HttpContextBase FakeHttpContext()
        {
            var context  = new Mock <HttpContextBase>();
            var request  = new Mock <HttpRequestBase>();
            var response = new Mock <HttpResponseBase>();
            var session  = new Mock <HttpSessionStateBase>();
            var server   = new Mock <HttpServerUtilityBase>();
            var user     = new MockPrincipal();

            context.SetupGet(ctx => ctx.Request).Returns(request.Object);
            context.SetupGet(ctx => ctx.Response).Returns(response.Object);
            context.SetupGet(ctx => ctx.Session).Returns(session.Object);
            context.SetupGet(ctx => ctx.Server).Returns(server.Object);
            context.SetupGet(ctx => ctx.User).Returns(user);

            return(context.Object);
        }