Example #1
0
        public void HiddenInputTag_does_not_output_name_attribute_for_unnamed_components()
        {
            var renderer = new DropDownListHtmlBuilder(new EditorDropDown("FontFace", new List <DropDownItem>()
            {
                new DropDownItem {
                    Text = "Arial", Value = "Arial,Verdana,sans-serif"
                }
            }));

            IHtmlNode tag = renderer.HiddenInputTag();

            Assert.False(tag.Attributes().ContainsKey("name"));
        }
        protected override IHtmlNode BuildCore()
        {
            var li = new HtmlTag("li")
                    .AddClass("t-editor-dropdown");

            var builder = new DropDownListHtmlBuilder(dropDown);

            IHtmlNode rootTag = builder.Build();

            builder.InnerContentTag().AppendTo(rootTag);
            builder.HiddenInputTag().AppendTo(rootTag);

            rootTag.AppendTo(li);

            return li;
        }
Example #3
0
        public void HiddenInputTag_should_render_input()
        {
            IHtmlNode tag = renderer.HiddenInputTag();

            Assert.Equal("input", tag.TagName);
        }
        public void HiddenInputTag_does_not_output_name_attribute_for_unnamed_components()
        {
            var renderer = new DropDownListHtmlBuilder(new EditorDropDown("FontFace", new List<DropDownItem>() { new DropDownItem { Text = "Arial", Value = "Arial,Verdana,sans-serif" } } ));

            IHtmlNode tag = renderer.HiddenInputTag();

            Assert.False(tag.Attributes().ContainsKey("name"));
        }