Ejemplo n.º 1
0
        public void PadValue()
        {
            const string html = "<p pad-value='?'>Oi, tudo bem?</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var          actual   = paragraphGridRender.Render(57);
            const string expected = "Oi, tudo bem?????????????????????????????????????????????";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void TextCenter()
        {
            const string html = "<p text-center>Oi, tudo bem?</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var          actual   = paragraphGridRender.Render(57);
            const string expected = "                      Oi, tudo bem?                      ";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void BottomBorder()
        {
            const string html = "<p bottom-border>Oi, tudo bem?</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                "Oi, tudo bem?                                            " + Environment.NewLine +
                "---------------------------------------------------------";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void AllBorders()
        {
            const string html = "<p all-borders>Oi, tudo bem?</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                "+-------------------------------------------------------+" + Environment.NewLine +
                "|Oi, tudo bem?                                          |" + Environment.NewLine +
                "+-------------------------------------------------------+";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 5
0
        public void Border_Bottom_Left()
        {
            const string html = "<p border='x' border-bottom-left='.'>Oi, tudo bem?</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + Environment.NewLine +
                "xOi, tudo bem?                                          x" + Environment.NewLine +
                ".xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 6
0
        public void Edge()
        {
            const string html = "<p edge='x'>Oi, tudo bem?</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx " + Environment.NewLine +
                "xOi, tudo bem?                                          x" + Environment.NewLine +
                " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 7
0
        public void Corner()
        {
            const string html = "<p corner='.' border='x'>Oi, tudo bem?</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                ".xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx." + Environment.NewLine +
                "xOi, tudo bem?                                          x" + Environment.NewLine +
                ".xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 8
0
        public void FiveLines_TextRight_TextBottom()
        {
            const string html = "<p height='5' text-right text-bottom>Lorem Ipsum.</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                "                                                         " + Environment.NewLine +
                "                                                         " + Environment.NewLine +
                "                                                         " + Environment.NewLine +
                "                                                         " + Environment.NewLine +
                "                                             Lorem Ipsum.";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 9
0
        public void FiveLines_TextCenter_TextMiddle()
        {
            const string html = "<p height='5' text-center text-middle>Lorem Ipsum.</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                "                                                         " + Environment.NewLine +
                "                                                         " + Environment.NewLine +
                "                      Lorem Ipsum.                       " + Environment.NewLine +
                "                                                         " + Environment.NewLine +
                "                                                         ";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 10
0
        public void FiveLines_TextJustified_TextTop()
        {
            const string html = "<p height='5' text-justified text-top>Lorem Ipsum.</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                "Lorem Ipsum.                                             " + Environment.NewLine +
                "                                                         " + Environment.NewLine +
                "                                                         " + Environment.NewLine +
                "                                                         " + Environment.NewLine +
                "                                                         ";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 11
0
        public void TextCenter_LongText()
        {
            const string html = "<p text-center>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>";
            var          paragraphGridRender = new ParagraphGridRender(html);

            var actual   = paragraphGridRender.Render(57);
            var expected =
                "  Lorem Ipsum is simply dummy text of the printing and   " + Environment.NewLine +
                "typesetting industry. Lorem Ipsum has been the industry's" + Environment.NewLine +
                "standard dummy text ever since the 1500s, when an unknown" + Environment.NewLine +
                "printer took a galley of type and scrambled it to make a " + Environment.NewLine +
                "    type specimen book. It has survived not only five    " + Environment.NewLine +
                "centuries, but also the leap into electronic typesetting," + Environment.NewLine +
                " remaining essentially unchanged. It was popularised in  " + Environment.NewLine +
                "the 1960s with the release of Letraset sheets containing " + Environment.NewLine +
                "  Lorem Ipsum passages, and more recently with desktop   " + Environment.NewLine +
                "   publishing software like Aldus PageMaker including    " + Environment.NewLine +
                "                versions of Lorem Ipsum.                 ";

            Assert.AreEqual(expected, actual);
        }
        private static string ParagraphContent(this HtmlNode htmlNode, int width)
        {
            var render = new ParagraphGridRender(htmlNode);

            return(render.Render(width));
        }