Пример #1
0
        public void MultiElementsTest()
        {
            Paragraph p = new Paragraph("This is a text ");

            p.AddElement(new Bold("bold text"));
            p.AddElement(new LineBreak());

            Assert.Equal("<p>This is a text <b>bold text</b><br></p>", p.ToHtml());
        }
Пример #2
0
        public void MultiElementsTest()
        {
            string    text = "text";
            Header4   h4   = new Header4(text);
            Paragraph p    = new Paragraph($"This is a text ");

            p.AddElement(h4);
            Assert.Equal($"<p>This is a text <h4>{text}</h4></p>", p.ToHtml());
        }
Пример #3
0
        public void MultiElementsTest()
        {
            Bold      bold = new Bold("bold text");
            Paragraph p    = new Paragraph("This is a text ");

            p.AddElement(bold);

            Assert.Equal("<p>This is a text <b>bold text</b></p>", p.ToHtml());
        }
Пример #4
0
        public void MultiElementsTest()
        {
            string id    = "id1";
            string name  = "name1";
            string style = "color:red";
            string href  = "#";
            string text  = "Website 1";

            Anchor    anchor = new Anchor(id, name, href, text, AnchorTarget.Self, style);
            string    value  = "This is a text for ";
            Paragraph para   = new Paragraph(value);

            para.AddElement(anchor);
            Body body = new Body(para);

            Assert.Equal($"<body><p>This is a text for <a id=\"{id}\" name=\"{name}\" href=\"{href}\" style=\"{style}\">{text}</a></p></body>", body.ToHtml());
        }