当前位置: 首页>>代码示例>>C#>>正文


C# RadioButton.ShouldHaveHtmlNode方法代码示例

本文整理汇总了C#中RadioButton.ShouldHaveHtmlNode方法的典型用法代码示例。如果您正苦于以下问题:C# RadioButton.ShouldHaveHtmlNode方法的具体用法?C# RadioButton.ShouldHaveHtmlNode怎么用?C# RadioButton.ShouldHaveHtmlNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RadioButton的用法示例。


在下文中一共展示了RadioButton.ShouldHaveHtmlNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: can_get_a_radio_button_with_label_after

 public void can_get_a_radio_button_with_label_after()
 {
     var html = new RadioButton("foo.Bar").Value(10).LabelAfter("Ten").ToString();
     var radioInput = html.ShouldHaveHtmlNode("foo_Bar_10");
     radioInput.ShouldBeNamed(HtmlTag.Input);
     radioInput.ShouldBeNamed(HtmlTag.Input);
     radioInput.ShouldHaveAttribute(HtmlAttribute.Id).WithValue("foo_Bar_10");
     radioInput.ShouldHaveAttribute(HtmlAttribute.Name).WithValue("foo.Bar");
     radioInput.ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Radio);
     radioInput.ShouldHaveAttribute(HtmlAttribute.Value).WithValue("10");
     radioInput.ShouldNotHaveAttribute(HtmlAttribute.Checked);
     var label = html.ShouldHaveHtmlNode("foo_Bar_10_Label");
     label.ShouldHaveAttribute(HtmlAttribute.For).WithValue("foo_Bar_10");
     label.ShouldHaveInnerTextEqual("Ten");
 }
开发者ID:atomicobject,项目名称:mvccontrib,代码行数:15,代码来源:RadioButtonTests.cs

示例2: can_get_a_checked_radio_button

 public void can_get_a_checked_radio_button()
 {
     var html = new RadioButton("foo.Bar").Value(10).Checked(true).ToString();
     var element = html.ShouldHaveHtmlNode("foo_Bar_10");
     element.ShouldHaveAttribute(HtmlAttribute.Checked).WithValue(HtmlAttribute.Checked);
 }
开发者ID:atomicobject,项目名称:mvccontrib,代码行数:6,代码来源:RadioButtonTests.cs


注:本文中的RadioButton.ShouldHaveHtmlNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。