예제 #1
0
        public override void Given()
        {
            constraint = new AreaConstraint(new TestAreaRegistration());

            var routeData = new RouteData();

            var httpContextBase = CreateStub <HttpContextBase>();

            httpContextBase.Stub(x => x.Request).Return(CreateStub <HttpRequestBase>());

            controllerContext = new ControllerContext
            {
                RequestContext = new RequestContext(httpContextBase, routeData),
            };
        }
예제 #2
0
        public override void Given()
        {
            constraint = new AreaConstraint(new TestAreaRegistration());

            var routeData = new RouteData();
            routeData.DataTokens.Add("area", "Test2");
            routeData.Values.Add("area", "Test2");

            var httpContextBase = CreateStub<HttpContextBase>();
            httpContextBase.Stub(x => x.Request).Return(CreateStub<HttpRequestBase>());

            controllerContext = new ControllerContext
            {
                RequestContext = new RequestContext(httpContextBase, routeData),
            };
        }