Esempio n. 1
0
        public void TestFooter()
        {
            Body2004 bd = new Body2004();

            bd.Footer.AddEle(Paragraph.With("footer01"));
            Assert.AreEqual(2, TestUtils.RegexCount(bd.Content, "<*w:ftr"));
            Assert.AreEqual(1, TestUtils.RegexCount(bd.Content, "<w:t>footer01</w:t>"));
        }
Esempio n. 2
0
        public void TestHeader()
        {
            Body2004 bd = new Body2004();

            bd.Header.AddEle(Paragraph.With("header01"));
            Assert.AreEqual(2, TestUtils.RegexCount(bd.Content, "<*w:hdr"));
            Assert.AreEqual(1, TestUtils.RegexCount(bd.Content, "<w:t>header01</w:t>"));
        }
Esempio n. 3
0
        public void TestHeaderAndFooterSame()
        {
            Body2004 bd = new Body2004();

            bd.Header.AddEle(Paragraph.With("header01"));
            bd.Footer.AddEle(Paragraph.With("footer01"));
            Assert.AreEqual(1, TestUtils.RegexCount(bd.Content, "<w:t>header01</w:t>"));
            Assert.AreEqual(1, TestUtils.RegexCount(bd.Content, "<w:t>footer01</w:t>"));
            Console.WriteLine(bd.Content);
        }
Esempio n. 4
0
        public void TestAaddEleString()
        {
            Body2004 bd = new Body2004();

            bd.AddEle("<w:p wsp:rsidR=\"008979E8\" wsp:rsidRDefault=\"008979E8\"/>"); //this is a breakline
            Assert.AreEqual(2, TestUtils.RegexCount(bd.Content, "<*w:body>"));
            Assert.AreEqual(1,
                            TestUtils.RegexCount(bd.Content,
                                                 "<w:p wsp:rsidR=\"008979E8\" wsp:rsidRDefault=\"008979E8\"/>"));
        }
Esempio n. 5
0
        public void TestshowHeaderAndFooter()
        {
            Body2004 bd = new Body2004();

            bd.Header.AddEle(Paragraph.With("p1"));
            Assert.False(bd.Header.GetHideHeaderAndFooterFirstPage()); // default is false

            Assert.AreEqual(1, TestUtils.RegexCount(bd.Content, "<w:t>p1</w:t>"));
            Assert.AreEqual(2, TestUtils.RegexCount(bd.Content, "<*w:sectPr"));

            Assert.AreEqual(0, TestUtils.RegexCount(bd.Content, "<w:hdr w:type=\"first\">"));
            Assert.AreEqual(0, TestUtils.RegexCount(bd.Content, "<w:ftr w:type=\"first\">"));

            Assert.AreEqual(0, TestUtils.RegexCount(bd.Content, "<w:pgSz w:w"));
            Assert.AreEqual(0, TestUtils.RegexCount(bd.Content, "<w:pgMar"));
            Assert.AreEqual(0, TestUtils.RegexCount(bd.Content, "<w:cols w:space"));
        }
Esempio n. 6
0
        public void SanityTest()
        {
            Body2004 bd = new Body2004();

            Assert.AreEqual(2, TestUtils.RegexCount(bd.Content, "<*w:body>"));
        }