Пример #1
0
 public void ToString_should_render_label()
 {
     string expected = "<input id=\"foo\" type=\"checkbox\"/><label for=\"foo\">Bar</label>";
     var field = new CheckBoxField(new Hash(id => "foo", label => "Bar"));
     string html = field.ToString();
     Assert.That(html, Is.EqualTo(expected));
 }
Пример #2
0
 public void ToString_should_not_render_label_with_no_id()
 {
     string expected = "<input type=\"checkbox\"/>";
     var field = new CheckBoxField(new Hash(label => "Bar"));
     string html = field.ToString();
     Assert.That(html, Is.EqualTo(expected));
 }