public void RendersRequiredCheckBoxAttributes() { renderer.RenderCheckBoxListInput(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.AreEqual("<input id=\"checkbox_0\" name=\"checkbox$0\" type=\"checkbox\" />", writer.InnerWriter.ToString(), "checkbox required attributes not rendered properly"); }
public void RendersPostBackHandler() { control.AutoPostBack = true; renderer.RenderCheckBoxListInput(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.IsTrue(writer.InnerWriter.ToString().Contains("onclick=\"javascript:setTimeout('__doPostBack(\\'checkbox$0\\',\\'\\')', 0)\""), "postback handler not rendered"); }
public void RendersTabIndex() { control.TabIndex = 4; renderer.RenderCheckBoxListInput(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.IsTrue(writer.InnerWriter.ToString().Contains("tabindex=\"4\""), "tabindex attribute not rendered"); }
public void RendersAccessKey() { control.AccessKey = "C"; renderer.RenderCheckBoxListInput(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.IsTrue(writer.InnerWriter.ToString().Contains("accesskey=\"C\""), "accesskey attribute not rendered"); }
public void RendersChecked() { listItem.Selected = true; renderer.RenderCheckBoxListInput(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.IsTrue(writer.InnerWriter.ToString().Contains("checked=\"checked\""), "checked attribute not rendered"); }
public void RendersDisabled() { listItem.Enabled = false; renderer.RenderCheckBoxListInput(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.IsTrue(writer.InnerWriter.ToString().Contains("disabled=\"disabled\""), "disabled attribute not rendered"); }
public void RendersValue() { listItem.Value = "test"; renderer.RenderCheckBoxListInput(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.IsTrue(writer.InnerWriter.ToString().Contains("value=\"test\""), "list item value not rendered"); }
public void RendersNoLabelWhenTextAndValueAreEmpty() { listItem.Text = String.Empty; listItem.Value = String.Empty; renderer.RenderCheckBoxListLabel(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.AreEqual(String.Empty, writer.InnerWriter.ToString(), "label not rendered properly"); }
public void RendersLabelWithValue() { listItem.Text = String.Empty; listItem.Value = "value"; renderer.RenderCheckBoxListLabel(writer, listItem, CheckBoxListHtmlRenderer.GetListItemClientID(control, listItem)); Assert.AreEqual("<label for=\"checkbox_0\">value</label>", writer.InnerWriter.ToString(), "label not rendered properly"); }
public void SetUp() { writer = new HtmlTextWriter(new StringWriter()); control = new CheckBoxList(); control.ID = "checkbox"; control.CssClass = "someclass"; control.RepeatDirection = RepeatDirection.Horizontal; listItem = new ListItem(); control.Items.Add(listItem); renderer = new CheckBoxListHtmlRenderer(control); }