public void TestSetGetAlignment() { //new clean instance of paragraph XWPFDocument doc = new XWPFDocument(); XWPFParagraph p = doc.CreateParagraph(); Assert.AreEqual(ParagraphAlignment.LEFT, p.GetAlignment()); CT_P ctp = p.GetCTP(); CT_PPr ppr = ctp.pPr == null?ctp.AddNewPPr() : ctp.pPr; CT_Jc align = ppr.AddNewJc(); align.val = (ST_Jc.center); Assert.AreEqual(ParagraphAlignment.CENTER, p.GetAlignment()); p.SetAlignment(ParagraphAlignment.BOTH); Assert.AreEqual((int)ST_Jc.both, (int)ppr.jc.val); }