public void TestCreateRow() { XWPFDocument doc = new XWPFDocument(); CT_Tbl table = new CT_Tbl(); CT_Row r1 = table.AddNewTr(); r1.AddNewTc().AddNewP(); r1.AddNewTc().AddNewP(); CT_Row r2 = table.AddNewTr(); r2.AddNewTc().AddNewP(); r2.AddNewTc().AddNewP(); CT_Row r3 = table.AddNewTr(); r3.AddNewTc().AddNewP(); r3.AddNewTc().AddNewP(); XWPFTable xtab = new XWPFTable(table, doc); Assert.AreEqual(3, xtab.NumberOfRows); Assert.IsNotNull(xtab.GetRow(2)); //add a new row xtab.CreateRow(); Assert.AreEqual(4, xtab.NumberOfRows); //check number of cols Assert.AreEqual(2, table.GetTrArray(0).SizeOfTcArray()); //check creation of first row xtab = new XWPFTable(new CT_Tbl(), doc); Assert.AreEqual(1, xtab.GetCTTbl().GetTrArray(0).SizeOfTcArray()); }
public void TestSetGetHeight() { XWPFDocument doc = new XWPFDocument(); CT_Tbl table = new CT_Tbl(); XWPFTable xtab = new XWPFTable(table, doc); XWPFTableRow row = xtab.CreateRow(); row.Height = (20); Assert.AreEqual(20, row.Height); }