public void should_add_default_option_to_top_of_list() { var tag = new SelectTag(); tag.Option("a", "1"); tag.Option("b", "2"); tag.DefaultOption("bar"); tag.Children[0].Text().ShouldEqual("bar"); }
public void should_make_the_default_option_selected() { var tag = new SelectTag(); tag.Option("a", "1"); tag.Option("b", "2"); tag.DefaultOption("bar"); tag.Children[0].Attr("selected").ShouldEqual("selected"); tag.Children[1].HasAttr("selected").ShouldBeFalse(); tag.Children[2].HasAttr("selected").ShouldBeFalse(); }