示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
            }
        }
示例#5
0
        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);
        }