示例#1
0
        public void TestCompareAbstractNum()
        {
            XWPFDocument  doc       = XWPFTestDataSamples.OpenSampleDocument("Numbering.docx");
            XWPFNumbering numbering = doc.GetNumbering();
            int           numId     = 1;

            Assert.IsTrue(numbering.NumExist(numId.ToString()));
            XWPFNum         num                = numbering.GetNum(numId.ToString());
            string          abstrNumId         = num.GetCTNum().abstractNumId.val;
            XWPFAbstractNum abstractNum        = numbering.GetAbstractNum(abstrNumId);
            string          CompareAbstractNum = numbering.GetIdOfAbstractNum(abstractNum);

            Assert.AreEqual(abstrNumId, CompareAbstractNum);
        }
示例#2
0
        public void TestAddNumberingToDoc()
        {
            string abstractNumId = "1";
            string numId         = "1";

            XWPFDocument  docOut    = new XWPFDocument();
            XWPFNumbering numbering = docOut.CreateNumbering();

            numId = numbering.AddNum(abstractNumId);

            XWPFDocument docIn = XWPFTestDataSamples.WriteOutAndReadBack(docOut);

            numbering = docIn.GetNumbering();
            Assert.IsTrue(numbering.NumExist(numId));
            XWPFNum num = numbering.GetNum(numId);

            string CompareAbstractNum = num.GetCTNum().abstractNumId.val;

            Assert.AreEqual(abstractNumId, CompareAbstractNum);
        }