Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
		private HtmlNode GetRadioButton(HtmlNode element, string name, int keyValue)
		{
			return element.ShouldHaveChildNode(string.Format("{0}_{1}", name.FormatAsHtmlId(), keyValue));
		}
Ejemplo n.º 3
0
 private HtmlNode GetCheckBox(HtmlNode element, string name, int index)
 {
     return element.ShouldHaveChildNode(string.Format("{0}_{1}", name.FormatAsHtmlId(), index));
 }