public void basic_construction() { var tag = new CheckboxTag(true); tag.TagName().ShouldEqual("input"); tag.Attr("type").ShouldEqual("checkbox"); }
public MvcCheckboxElement(string id, string name, bool isChecked) : base("") { NoTag(); Tag = new CheckboxTag(isChecked); Tag.Id(id).Name(name); if (isChecked) { Tag .Attr("checked", "checked") ; } Tag.Value("true"); Append(Tag); Append(new HiddenTag().Name(name).Value("false")); }
public void create_checkbox_that_is_checked() { var tag = new CheckboxTag(true); tag.Attr("checked").ShouldEqual("true"); }