Пример #1
0
        public ControllerTestContext(ControllerBase controller)
        {
            ViewEngine = new MockViewEngine();

            TestContext = new HttpContextTestContext();

            var controllerContext = new ControllerContext(
                new RequestContext(TestContext.Context, new RouteData()),
                controller);

            controller.ControllerContext = controllerContext;
        }
Пример #2
0
        public ControllerTestContext(ControllerBase controller)
        {
            ViewEngine = new MockViewEngine();

            TestContext = new HttpContextTestContext();

            var controllerContext = new ControllerContext(
                new RequestContext(TestContext.Context, new RouteData()),
                controller);

            controller.ControllerContext = controllerContext;
        }