public void RenderTest() { var target = new CheckBoxSelectMultiple(); target.Choices = ChoiceHelper.Range(1, 5); Assert.AreEqual("<ul>\n<li><label><input name=\"Test1\" type=\"checkbox\" value=\"1\" /> 1</label></li>\n<li><label><input name=\"Test1\" type=\"checkbox\" value=\"2\" /> 2</label></li>\n<li><label><input name=\"Test1\" type=\"checkbox\" value=\"3\" /> 3</label></li>\n<li><label><input name=\"Test1\" type=\"checkbox\" value=\"4\" /> 4</label></li>\n<li><label><input name=\"Test1\" type=\"checkbox\" value=\"5\" /> 5</label></li>\n</ul>", target.Render("Test1", null)); Assert.AreEqual("<ul>\n<li><label><input name=\"Test1\" type=\"checkbox\" value=\"1\" /> 1</label></li>\n<li><label><input name=\"Test1\" type=\"checkbox\" checked=\"checked\" value=\"2\" /> 2</label></li>\n<li><label><input name=\"Test1\" type=\"checkbox\" value=\"3\" /> 3</label></li>\n<li><label><input name=\"Test1\" type=\"checkbox\" checked=\"checked\" value=\"4\" /> 4</label></li>\n<li><label><input name=\"Test1\" type=\"checkbox\" checked=\"checked\" value=\"5\" /> 5</label></li>\n</ul>", target.Render("Test1", new object [] { 2, 4, 5 })); ElementAttributesDictionary extraAttributes = new ElementAttributesDictionary { { "id", "Test1" } }; Assert.AreEqual("<ul>\n<li><label for=\"Test1_0\"><input id=\"Test1_0\" name=\"Test1\" type=\"checkbox\" value=\"1\" /> 1</label></li>\n<li><label for=\"Test1_1\"><input id=\"Test1_1\" name=\"Test1\" type=\"checkbox\" checked=\"checked\" value=\"2\" /> 2</label></li>\n<li><label for=\"Test1_2\"><input id=\"Test1_2\" name=\"Test1\" type=\"checkbox\" value=\"3\" /> 3</label></li>\n<li><label for=\"Test1_3\"><input id=\"Test1_3\" name=\"Test1\" type=\"checkbox\" checked=\"checked\" value=\"4\" /> 4</label></li>\n<li><label for=\"Test1_4\"><input id=\"Test1_4\" name=\"Test1\" type=\"checkbox\" checked=\"checked\" value=\"5\" /> 5</label></li>\n</ul>", target.Render("Test1", new object[] { 2, 4, 5 }, extraAttributes)); }
public void CheckBoxSelectMultipleConstructorTest() { CheckBoxSelectMultiple target = new CheckBoxSelectMultiple(); // Pass }
public void IdForLabelTest() { var target = new CheckBoxSelectMultiple(); Assert.AreEqual("Test1_0", target.IdForLabel("Test1")); }