public void ButtonTag_should_render_link_with_span_in_it()
        {
            HeaderButton button = new HeaderButton {
                Name = "foo", CssClass = "bar", Url = "baz"
            };

            IHtmlNode linkTag = renderer.ButtonTag(button);

            linkTag.Children.ShouldNotBeEmpty();
            linkTag.TagName.ShouldEqual("a");
            linkTag.ShouldHaveClasses(UIPrimitives.Link);
            linkTag.Children[0].TagName.ShouldEqual("span");
        }
Exemplo n.º 2
0
        protected override void WriteHtml(HtmlTextWriter writer)
        {
            Guard.IsNotNull(writer, "writer");

            IWindowHtmlBuilder builder = builderFactory.Create(this);

            IHtmlNode windowTag = builder.WindowTag();

            //Header
            IHtmlNode headerTag = builder.HeaderTag().AppendTo(windowTag);

            builder.TitleTag().AppendTo(headerTag);

            if (Buttons.Container.Count > 0)
            {
                IHtmlNode buttonContainerTag = builder.ButtonContainerTag().AppendTo(headerTag);
                Buttons.Container.Each(button => builder.ButtonTag(button).AppendTo(buttonContainerTag));
            }

            //Content
            builder.ContentTag().AppendTo(windowTag);

            //output window HTML
            windowTag.WriteTo(writer);

            base.WriteHtml(writer);
        }