Example #1
0
        public API_Moq_HttpContext createBaseMocks()
        {
            MockContext  = new Mock <HttpContextBase>();
            MockRequest  = new Mock <HttpRequestBase>();
            MockResponse = new Mock <HttpResponseBase>();
            MockSession  = new MockHttpSession();
            MockServer   = new Mock <HttpServerUtilityBase>();


            MockContext.Setup(ctx => ctx.Request).Returns(MockRequest.Object);
            MockContext.Setup(ctx => ctx.Response).Returns(MockResponse.Object);
            MockContext.Setup(ctx => ctx.Session).Returns(MockSession);
            MockContext.Setup(ctx => ctx.Server).Returns(MockServer.Object);


            HttpContextBase  = MockContext.Object;
            HttpRequestBase  = MockRequest.Object;
            HttpResponseBase = MockResponse.Object;

            return(this);
        }
Example #2
0
        public API_Moq_HttpContext createBaseMocks()
        {
            MockContext = new Mock<HttpContextBase>();
            MockRequest = new Mock<HttpRequestBase>();
            MockResponse = new Mock<HttpResponseBase>();
            MockSession = new MockHttpSession();
            MockServer = new Mock<HttpServerUtilityBase>();

            MockContext.Setup(ctx => ctx.Request).Returns(MockRequest.Object);
            MockContext.Setup(ctx => ctx.Response).Returns(MockResponse.Object);
            MockContext.Setup(ctx => ctx.Session).Returns(MockSession);
            MockContext.Setup(ctx => ctx.Server).Returns(MockServer.Object);

            HttpContextBase = MockContext.Object;
            HttpRequestBase = MockRequest.Object;
            HttpResponseBase = MockResponse.Object;

            return this;
        }