Inheritance: BootstrapComponents.Core.CloseableHtml
 public FormGroup(Form form, params Func<FormGroup, IFormControl>[] controls)
     : base("div", false)
 {
     _form = form;
     _controls = controls;
     Attrs["class"] += "form-group";
 }
        public void NullHtmlHelperForTestingShouldntBreak()
        {
            var output = new StringBuilder();
            var writer = new StringBuilderWriter(output);
            using (var form = new Form(writer, null))
            {

            }
            Assert.AreEqual("", output.ToString());
        }
 public void EmptyFormGroup()
 {
     var output = new StringBuilder();
     var writer = new StringBuilderWriter(output);
     using (var form = new Form(writer, null))
     {
         writer.Write(form.Group());
     }
     Assert.AreEqual("<div class=\"form-group\"></div>", output.ToString());
 }
 public void GenerateLabelForScreenReaderIfMissing()
 {
     var output = new StringBuilder();
     var writer = new StringBuilderWriter(output);
     using (var form = new Form(writer, null))
     {
         writer.Write(form.Group(
             fg => fg.TextBox("Email", "*****@*****.**")
         ));
     }
     Assert.AreEqual("<div class=\"form-group\">" +
                         "<input class=\"form-control\" id=\"Email\" type=\"text\" value=\"[email protected]\" />" +
                         "<label class=\"sr-only\" for=\"Email\">Email</label>" +
                     "</div>", output.ToString());
 }
 public void BasicInputWithLabel()
 {
     var output = new StringBuilder();
     var writer = new StringBuilderWriter(output);
     using (var form = new Form(writer, null))
     {
         writer.Write(form.Group(
             fg => fg.Label("Email"),
             fg => fg.TextBox("Email", "*****@*****.**")
         ));
     }
     Assert.AreEqual("<div class=\"form-group\">" +
                         "<label for=\"Email\">Email</label>" +
                         "<input class=\"form-control\" id=\"Email\" type=\"text\" value=\"[email protected]\" />" +
                     "</div>", output.ToString());
 }