public void TestAddCarriageReturn() { ctRun.AddNewT().Value = ("TEST STRING"); ctRun.AddNewCr(); ctRun.AddNewT().Value = ("TEST2 STRING"); ctRun.AddNewCr(); ctRun.AddNewT().Value = ("TEST3 STRING"); Assert.AreEqual(2, ctRun.SizeOfCrArray()); XWPFRun run = new XWPFRun(new CT_R(), p); run.AppendText("T1"); run.AddCarriageReturn(); run.AddCarriageReturn(); run.AppendText("T2"); run.AddCarriageReturn(); Assert.AreEqual(3, run.GetCTR().GetCrList().Count); Assert.AreEqual("T1\n\nT2\n", run.ToString()); }
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()); }
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.SetText("T1"); run.AddCarriageReturn(); run.SetText("T2"); run.AddTab(); run.SetText("T3"); Assert.AreEqual(1, run.GetCTR().GetCrList().Count); Assert.AreEqual(1, run.GetCTR().GetTabList().Count); Assert.AreEqual("T1\nT2\tT3", run.ToString()); }