Exemplo n.º 1
0
        public void HTMLbuilder_indent()
        {
            HTML_builder builder = new HTML_builder();

            builder.indentLevelUp();
            builder.addContentWithEmptyLine("<head>");

            string HTMLcontent = builder.currentHTML();
            int    len         = HTMLcontent.Length;

            Assert.AreEqual("\n    <head>\n", HTMLcontent, "XYZ");
            Assert.AreEqual(12, len, "XYZ"); // Weaker, but the report will be
            // more clear (as it may be difficult to see with spaces).
        } //HTMLbuilder_indent()
Exemplo n.º 2
0
        public void HTML_builder_appendOperations()
        {
            HTML_builder builder = new HTML_builder();

            {
                builder.addContent("<head>");

                string HTMLcontent1 = builder.currentHTML(); // Side effect!
                int    len1         = HTMLcontent1.Length;

                Assert.AreEqual("<head>", HTMLcontent1, "XYZ");
                Assert.AreEqual(6, len1, "XYZ"); // Weaker, but the report
                // will be more clear (as it may be difficult spaces).
            }

            {
                builder.addContentOnSeparateLine("<head>");

                string HTMLcontent2 = builder.currentHTML(); // Side effect!
                int    len2         = HTMLcontent2.Length;

                Assert.AreEqual("<head>\n", HTMLcontent2, "XYZ");
                Assert.AreEqual(7, len2, "XYZ"); // Weaker, but the report
                // will be more clear (as it may be difficult spaces).
            }

            {
                builder.addContentWithEmptyLine("<head>");

                string HTMLcontent3 = builder.currentHTML(); // Side effect!
                int    len3         = HTMLcontent3.Length;

                Assert.AreEqual("\n<head>\n", HTMLcontent3, "XYZ");
                Assert.AreEqual(8, len3, "XYZ"); // Weaker, but the report
                // will be more clear (as it may be difficult spaces).
            }
        } //HTML_builder_appendOperations()