public void Test_DivElement_Render_With_SubElement() { Div t = new Div(); t.AddElement(new Element("test")); t.AddElement(new Div()); Assert.AreEqual("<div><test></test><div></div></div>", t.Render(), "There's no test tag inside div"); }
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()); }
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); }