Example #1
0
 protected XControl(string tag, params XControl[] xControls)
 {
     _control = new HtmlGeneric(tag);
     AddRange(xControls);
 }
Example #2
0
        public void GenericControl_AutoClose_Checkbox_Com_Atributos_E_InnerText()
        {
            HtmlGeneric selfClose = new HtmlGeneric("input"){SelfClose = true};
            selfClose.Attributes["type"] = "checkbox";
            selfClose.Attributes["value"] = "value";
            selfClose.Attributes["name"] = "name";
            selfClose.InnerText = "text";

            Assert.AreEqual("<input type=\"checkbox\" value=\"value\" name=\"name\" />text", Render(selfClose));
        }
Example #3
0
        public void GenericControl_AutoClose_Img()
        {
            HtmlGeneric selfClose = new HtmlGeneric("img"){SelfClose = true};

            Assert.AreEqual("<img />", Render(selfClose));
        }
Example #4
0
 private static string Render(HtmlGeneric generic)
 {
     StringWriter stringWriter = new StringWriter();
     HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
     generic.RenderControl(htmlTextWriter);
     return stringWriter.ToString();
 }
Example #5
0
 protected XControl(string tag, params XControl[] xControls)
 {
     _control = new HtmlGeneric(tag);
     AddRange(xControls);
 }