private string GetViewOutput(string viewName, string masterName) { BrailBase view = _viewEngine.Process(viewName, masterName); _viewContext = new ViewContext(controllerContext, view, new ViewDataDictionary(), new TempDataDictionary(), new StringWriter()); view.Render(_viewContext, _httpContext.Response.Output); return(_httpContext.Response.Output.ToString()); }
public void Should_Use_Custom_Base_Class() { _mocks.ReplayAll(); _viewEngine.Options.AssembliesToReference.Add(GetType().Assembly); _viewEngine.Options.BaseType = typeof(TestBrailBase).FullName; BrailBase view = _viewEngine.Process("view", null); Assert.IsInstanceOf <TestBrailBase>(view); }
public void Layout_And_View_Should_Have_ViewContext() { _mocks.ReplayAll(); BrailBase view = _viewEngine.Process("view", "/Master"); _viewContext = new ViewContext(controllerContext, view, new ViewDataDictionary(), new TempDataDictionary(), new StringWriter()); view.Render(_viewContext, _httpContext.Response.Output); Assert.IsNotNull(view.ViewContext); Assert.AreEqual(view.ViewContext, view.Layout.ViewContext); }
public void SetUp() { _mocks = new MockRepository(); _viewEngine = _mocks.DynamicMock <BooViewEngine>(); _view = _mocks.StrictMock <BrailBase>(_viewEngine); }