private void VerifyOption(string name, object value, object text, HtmlNode input, HtmlNode label) { input.ShouldBeNamed(HtmlTag.Input); input.ShouldHaveAttribute(HtmlAttribute.Name).WithValue(name); input.ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Radio); input.ShouldHaveAttribute(HtmlAttribute.Value).WithValue(value.ToString()); label.ShouldBeNamed(HtmlTag.Label); label.ShouldHaveInnerTextEqual(text.ToString()); }
internal static void VerifyOption(string name, object value, object text, HtmlNode input, HtmlNode label, bool isChecked) { input.ShouldBeNamed(HtmlTag.Input); input.ShouldHaveAttribute(HtmlAttribute.Name).WithValue(name); input.ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Radio); input.ShouldHaveAttribute(HtmlAttribute.Value).WithValue(value.ToString()); if(isChecked) { input.ShouldHaveAttribute(HtmlAttribute.Checked).WithValue(HtmlAttribute.Checked); } else { input.ShouldNotHaveAttribute(HtmlAttribute.Checked); } label.ShouldBeNamed(HtmlTag.Label); label.ShouldHaveInnerTextEqual(text.ToString()); }