private void UpdateRender(View.Render.Message message, ITabSetupContext context) { var model = GetModel(context.GetTabStore()); // Last message in is the first/primary view model.ViewRenderTime = Math.Round(message.Duration.TotalMilliseconds, 2); }
public void ReturnResult(Metadata sut, ITabContext context, View.Render.Message renderMessage) { context.TabStore.Setup(ds => ds.Contains(typeof(IList <View.Render.Message>).AssemblyQualifiedName)).Returns(true); context.TabStore.Setup(ds => ds.Get(typeof(IList <View.Render.Message>).AssemblyQualifiedName)).Returns(new List <View.Render.Message> { renderMessage }); var result = sut.GetData(context) as List <MetadataItemModel>; Assert.NotNull(result); Assert.NotEmpty(result); }
public void SetProperties(ViewEngine.FindViews.Message findViewMessage, View.Render.Message viewRenderMessage) { var model = new ViewsModel(findViewMessage, viewRenderMessage); Assert.Equal(findViewMessage.ViewName, model.ViewName); Assert.Equal(findViewMessage.MasterName, model.MasterName); Assert.Equal(findViewMessage.IsPartial, model.IsPartial); Assert.Equal(findViewMessage.BaseType, model.ViewEngineType); Assert.Equal(findViewMessage.UseCache, model.UseCache); Assert.Equal(findViewMessage.IsFound, model.IsFound); Assert.Equal(findViewMessage.SearchedLocations, model.SearchedLocations); Assert.NotNull(model.ViewModelSummary); }
public ViewsModel(ViewEngine.FindViews.Message viewEngineFindView, View.Render.Message viewRender) { ViewName = viewEngineFindView.ViewName; MasterName = viewEngineFindView.MasterName; IsPartial = viewEngineFindView.IsPartial; ViewEngineType = viewEngineFindView.BaseType; UseCache = viewEngineFindView.UseCache; IsFound = viewEngineFindView.IsFound; SearchedLocations = viewEngineFindView.SearchedLocations; if (viewRender != null) { SourceController = viewRender.ControllerName; ViewModelSummary = new ViewModelSummary(viewRender.ViewData, viewRender.TempData, viewRender.ViewDataModelType, viewRender.ModelStateIsValid, viewEngineFindView.DisplayModeId, viewEngineFindView.DisplayModeType); } }
public void ReturnResult(Views sut, ITabContext context, View.Render.Arguments renderArgs, ViewEngine.FindViews.Message findViewMessage, View.Render.Message renderMessage) { context.TabStore.Setup(ds => ds.Contains(typeof(IList <ViewEngine.FindViews.Message>).AssemblyQualifiedName)).Returns(true); context.TabStore.Setup(ds => ds.Get(typeof(IList <ViewEngine.FindViews.Message>).AssemblyQualifiedName)).Returns(new List <ViewEngine.FindViews.Message> { findViewMessage }); context.TabStore.Setup(ds => ds.Contains(typeof(IList <View.Render.Message>).AssemblyQualifiedName)).Returns(true); context.TabStore.Setup(ds => ds.Get(typeof(IList <View.Render.Message>).AssemblyQualifiedName)).Returns(new List <View.Render.Message> { renderMessage }); var result = sut.GetData(context) as List <ViewsModel>; Assert.NotNull(result); Assert.NotEmpty(result); }