public void place_label_tag() { var layout = new DefinitionListLabelAndField(); var label = new HtmlTag("span").Text("some text"); layout.LabelTag = label; layout.LabelTag.ShouldBeTheSameAs(label); }
public void replace_the_label() { var layout = new DefinitionListLabelAndField(); var label = new HtmlTag("span").Text("some text"); layout.LabelTag = label; var display = new TextboxTag().Attr("value", "something"); layout.LabelTag = display; layout.LabelTag.ShouldBeTheSameAs(display); }
public void write_to_string() { var layout = new DefinitionListLabelAndField(); var label = new HtmlTag("span").Text("some text"); layout.LabelTag = label; var display = new TextboxTag().Attr("value", "something"); layout.BodyTag = display; var html = layout.ToString(); html.ShouldContain(label.ToString()); html.ShouldContain(display.ToString()); }
public void SetUp() { layout = new DefinitionListLabelAndField(); expression = new FormLineExpression<ViewModel>(new StubTagGenerator<ViewModel>(), layout, x => x.Name); }
public void a_basic_test() { var registry = new FubuRegistry(x => { x.HtmlConvention<DefaultHtmlConventions>(); }); var container = new Container(); FubuApplication.For(registry).StructureMap(container).Bootstrap(); var tags = container.GetInstance<TagGenerator<AddressViewModel>>(); tags.Model = new AddressViewModel() { ShouldShow = true }; var form = new SimpleForm<AddressViewModel, DefinitionListLabelAndField>(tags); theRenderedFormLine = form.Display(p => p.ShouldShow); var xx = theRenderedFormLine.Render(); xx.ShouldContain(tags.LabelFor(x=>x.ShouldShow).ToString()); xx.ShouldContain(tags.DisplayFor(x=>x.ShouldShow).ToString()); }