Example #1
0
        public void FieldSet_Com_Inputs_Text_E_Checkbox_E_Radio_E_Select_E_Submit()
        {
            XControl Fieldset = new FieldSet(new Legend("Titulo"),
                                             new InputText("nome-inputtext"),
                                             new Checkbox("nome-checkbox", "0", "solteiro?"),
                                             new Radio("nome-radio", "1", "desenvolvedor"),
                                             new Select("name",
                                                        new Option("value-option", "item1"),
                                                        new Option("value-option", "item2")))
                                .Add(new Submit("enviar"));

            string expected = "<fieldset>";

            expected += "<legend>Titulo</legend>";
            expected += "<input type=\"text\" name=\"nome-inputtext\" />";
            expected += "<input type=\"checkbox\" name=\"nome-checkbox\" value=\"0\" />solteiro?";
            expected += "<input type=\"radio\" name=\"nome-radio\" value=\"1\" />desenvolvedor";
            expected += "<select name=\"name\">";
            expected += "<option value=\"value-option\">item1</option>";
            expected += "<option value=\"value-option\">item2</option>";
            expected += "</select>";
            expected += "<input type=\"submit\" value=\"enviar\" />";
            expected += "</fieldset>";

            Assert.AreEqual(expected, Fieldset.ToString());
        }