public void ObjectTemplate_IgnoresPropertiesWith_ScaffoldColumnFalse() { // Arrange var expected = @"<div class=""editor-label""><label for=""Property1"">Property1</label></div>" + Environment.NewLine + @"<div class=""editor-field""><input class=""text-box single-line"" id=""Property1"" name=""Property1"" type=""text"" value="""" /> </div>" + Environment.NewLine + @"<div class=""editor-label""><label for=""Property3"">Property3</label></div>" + Environment.NewLine + @"<div class=""editor-field""><input class=""text-box single-line"" id=""Property3"" name=""Property3"" type=""text"" value="""" /> </div>" + Environment.NewLine; var model = new DefaultTemplatesUtilities.ObjectWithScaffoldColumn(); var viewEngine = new Mock <ICompositeViewEngine>(); viewEngine.Setup(v => v.FindPartialView(It.IsAny <ActionContext>(), It.IsAny <string>())) .Returns(ViewEngineResult.NotFound("", Enumerable.Empty <string>())); var htmlHelper = DefaultTemplatesUtilities.GetHtmlHelper(model, viewEngine.Object); // Act var result = DefaultEditorTemplates.ObjectTemplate(htmlHelper); // Assert Assert.Equal(expected, result); }
public void ObjectTemplate_IgnoresPropertiesWith_ScaffoldColumnFalse() { // Arrange var expected = @"<div class=""display-label"">Property1</div> <div class=""display-field""></div> <div class=""display-label"">Property3</div> <div class=""display-field""></div> "; var model = new DefaultTemplatesUtilities.ObjectWithScaffoldColumn(); var viewEngine = new Mock <ICompositeViewEngine>(); viewEngine.Setup(v => v.FindPartialView(It.IsAny <ActionContext>(), It.IsAny <string>())) .Returns(ViewEngineResult.NotFound("", Enumerable.Empty <string>())); var htmlHelper = DefaultTemplatesUtilities.GetHtmlHelper(model, viewEngine.Object); // Act var result = DefaultDisplayTemplates.ObjectTemplate(htmlHelper); // Assert Assert.Equal(expected, result); }