private void VerifyItem(string name, object value, object text, HtmlNode element, int index, bool @checked) { var input = element.ShouldHaveChildNode(string.Format("{0}_{1}", name.FormatAsHtmlId(), index)); input.ShouldBeNamed(HtmlTag.Input); input.ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Checkbox); input.ShouldHaveAttribute(HtmlAttribute.Name).WithValue(name); input.ShouldHaveAttribute(HtmlAttribute.Value).WithValue(value.ToString()); if (@checked) { input.ShouldHaveAttribute(HtmlAttribute.Checked).WithValue(HtmlAttribute.Checked); } else { input.ShouldNotHaveAttribute(HtmlAttribute.Checked); } var label = element.ShouldHaveChildNode(string.Format("{0}_{1}_Label", name.FormatAsHtmlId(), index)); label.ShouldBeNamed(HtmlTag.Label); label.ShouldHaveInnerTextEqual(text.ToString()); }
private HtmlNode GetRadioButton(HtmlNode element, string name, int keyValue) { return element.ShouldHaveChildNode(string.Format("{0}_{1}", name.FormatAsHtmlId(), keyValue)); }
private HtmlNode GetCheckBox(HtmlNode element, string name, int index) { return element.ShouldHaveChildNode(string.Format("{0}_{1}", name.FormatAsHtmlId(), index)); }