コード例 #1
0
        public void HiddenInputTag_does_not_output_name_attribute_for_unnamed_components()
        {
            var renderer = new ComboBoxHtmlBuilder(new EditorComboBox("FontFace", new List <DropDownItem>()
            {
                new DropDownItem {
                    Text = "Arial", Value = "Arial,Verdana,sans-serif"
                }
            }, TestHelper.CreateViewContext()));

            IHtmlNode tag = renderer.HiddenInputTag();

            Assert.False(tag.Attributes().ContainsKey("name"));
        }
コード例 #2
0
        protected override IHtmlNode BuildCore()
        {
            var li = new HtmlTag("li")
                    .AddClass("t-editor-combobox");

            var builder = new ComboBoxHtmlBuilder(comboBox);

            IHtmlNode rootTag = builder.Build();

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

            rootTag.AppendTo(li);

            return li;
        }
コード例 #3
0
        public void HiddenInputTag_should_render_input()
        {
            IHtmlNode tag = renderer.HiddenInputTag();

            Assert.Equal("input", tag.TagName);
        }
コード例 #4
0
        public void HiddenInputTag_does_not_output_name_attribute_for_unnamed_components()
        {
            var renderer = new ComboBoxHtmlBuilder(new EditorComboBox("FontFace", new List<DropDownItem>() { new DropDownItem { Text = "Arial", Value = "Arial,Verdana,sans-serif" } }, TestHelper.CreateViewContext() ));

            IHtmlNode tag = renderer.HiddenInputTag();

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