Exemple #1
0
        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());
        }
Exemple #2
0
        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.Render();

            html.ShouldContain(label.ToString());
            html.ShouldContain(display.ToString());
        }