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 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); }