Пример #1
0
        public void ToHtml()
        {
            var div  = new Div();
            var b    = new Bold();
            var i    = new Italic();
            var span = new Span();

            span.AddAttribute("class", "banana");
            span.AddContent("meu texto estiloso!");
            b.AddElement(i);
            i.AddElement(span);
            div.AddElement(b);

            Assert.Equal("<div><b><i><span class=\"banana\">meu texto estiloso!</span></i></b></div>", div.ToHTML());
        }
Пример #2
0
        static void Main(string[] args)
        {
            var div  = new Div();
            var b    = new Bold();
            var i    = new Italic();
            var span = new Span();

            span.AddAttribute("class", "banana");
            span.AddContent("meu texto estiloso!");
            b.AddElement(i);
            i.AddElement(span);
            div.AddElement(b);

            Console.WriteLine(div.ToHTML());

            //ProgramDecorator.MainDecorator(args);
        }