Ejemplo n.º 1
0
        public void SetUp()
        {
            _mocks = new MockRepository();
            var httpContext = new TestHttpContext();
            var requestContext = new RequestContext(httpContext, new RouteData());
            var controller = _mocks.StrictMock<ControllerBase>();
            _mocks.Replay(controller);

            var viewEngine = new BooViewEngine
                             	{
                             		ViewSourceLoader = new FileSystemViewSourceLoader(VIEW_ROOT_DIRECTORY),
                             		Options = new BooViewEngineOptions()
                             	};
            viewEngine.Initialize();

            _viewEngine = new BrailViewFactory(viewEngine);
            _mocks.ReplayAll();
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            _output = new StringWriter();
            _mocks = new MockRepository();
            _httpContext = _mocks.DynamicMock<HttpContextBase>(); //new TestHttpContext();
            var response = _mocks.DynamicMock<HttpResponseBase>();
            SetupResult.For(response.Output).Return(_output);
            SetupResult.For(_httpContext.Request).Return(_mocks.DynamicMock<HttpRequestBase>());
            SetupResult.For(_httpContext.Response).Return(response);
            //			SetupResult.For(_httpContext.Session).Return(_mocks.DynamicMock<HttpSessionStateBase>());
            var requestContext = new RequestContext(_httpContext, new RouteData());
            _controller = _mocks.StrictMock<Controller>();
            _mocks.Replay(_controller);

            controllerContext = new ControllerContext(requestContext, _controller);
            //			_viewContext = new ViewContext(controllerContext, null, new ViewDataDictionary(), null);

            _viewEngine = new BooViewEngine
                          	{
                          		ViewSourceLoader = new FileSystemViewSourceLoader(VIEW_ROOT_DIRECTORY),
                          		Options = new BooViewEngineOptions()
                          	};
            _viewEngine.Initialize();
            _mocks.Replay(_httpContext);
        }