Example #1
0
        public void TestAddTabsAndLineBreaks()
        {
            ctRun.AddNewT().Value = ("TEST STRING");
            ctRun.AddNewCr();
            ctRun.AddNewT().Value = (/*setter*/ "TEST2 STRING");
            ctRun.AddNewTab();
            ctRun.AddNewT().Value = (/*setter*/ "TEST3 STRING");
            Assert.AreEqual(1, ctRun.SizeOfCrArray());
            Assert.AreEqual(1, ctRun.SizeOfTabArray());

            XWPFRun run = new XWPFRun(new CT_R(), p);

            run.AppendText("T1");
            run.AddCarriageReturn();
            run.AppendText("T2");
            run.AddTab();
            run.AppendText("T3");
            Assert.AreEqual(1, run.GetCTR().GetCrList().Count);
            Assert.AreEqual(1, run.GetCTR().GetTabList().Count);

            Assert.AreEqual("T1\nT2\tT3", run.ToString());
        }