public void TestSetGetSpacingLineRule() { XWPFDocument doc = new XWPFDocument(); XWPFParagraph p = doc.CreateParagraph(); CT_P ctp = p.GetCTP(); CT_PPr ppr = ctp.pPr == null?ctp.AddNewPPr() : ctp.pPr; Assert.AreEqual(LineSpacingRule.AUTO, p.GetSpacingLineRule()); CT_Spacing spacing = ppr.AddNewSpacing(); spacing.lineRule = (ST_LineSpacingRule.atLeast); Assert.AreEqual(LineSpacingRule.ATLEAST, p.GetSpacingLineRule()); p.SetSpacingAfter(100); Assert.AreEqual(100, (int)spacing.after); }
public void TestSetGetSpacing() { XWPFDocument doc = new XWPFDocument(); XWPFParagraph p = doc.CreateParagraph(); CT_P ctp = p.GetCTP(); CT_PPr ppr = ctp.pPr == null?ctp.AddNewPPr() : ctp.pPr; Assert.AreEqual(-1, p.GetSpacingAfter()); CT_Spacing spacing = ppr.AddNewSpacing(); spacing.after = 10; Assert.AreEqual(10, p.GetSpacingAfter()); p.SetSpacingAfter(100); Assert.AreEqual(100, (int)spacing.after); }