@Test public void testParagraphOneWithStyle() { Paragraph p01 = (Paragraph) Paragraph.with("111").withStyle().align(ParagraphStyle.Align.CENTER).create(); basicParagraphCheckings(p01, "111", "center"); }
@Test public void testWithStyle() { IElement p01 = Paragraph.with("").withStyle().create(); assertEquals(p01.getContent(), ""); }
@Test public void sanityTestFluent() { IElement par = Paragraph.with("par01").withStyle().align(Align.CENTER).create(); basicParagraphCheckings(par, "par01", "center"); }
@Test public void testFluent(){ Paragraph p01 = (Paragraph) Paragraph.with("111").withStyle().align(ParagraphStyle.Align.CENTER).create(); basicParagraphCheckings(p01, "111", "center"); }
@Test public void testParagraphIndentStyle() { Paragraph p01 = (Paragraph) Paragraph.with("111").withStyle().indent(ParagraphStyle.Indent.ONE).create(); assertEquals(1, TestUtils.regexCount(p01.getContent(), "w:left=\"540\"")); }
@Test public void testWithStyleBgColor() { IElement p01 = Paragraph.with("par01").withStyle().bgColor("FFFF00").create(); assertEquals(1, TestUtils.regexCount(p01.getContent(), "FFFF00")); //Background Color basicParagraphCheckings(p01, "par01", "left"); }
@Test public void testBidi(){ ParagraphPiece pieces = ParagraphPiece.with("111"); Paragraph p01 = (Paragraph) Paragraph.withPieces(pieces).withStyle().bidi("HE").create(); basicParagraphCheckings(p01, "111", null); assertEquals(1, TestUtils.regexCount(p01.getContent(), "<w:lang w:bidi=\"HE\" />")); }
@Test public void testParagraphStyle() { Table tbl = new Table(); Paragraph p1 = (Paragraph) Paragraph.withPieces(ParagraphPiece.with("Flamengo").withStyle().bold().italic().create()).withStyle().align(Align.RIGHT).create(); tbl.addTableEle(TableEle.TD, p1); tableBasicCheckings(tbl.getContent()); assertEquals(1, TestUtils.regexCount(tbl.getContent(), "<w:b/>")); assertEquals(1, TestUtils.regexCount(tbl.getContent(), "<w:i/>")); assertEquals(1, TestUtils.regexCount(tbl.getContent(), "<w:jc w:val=\"right\"/>")); assertEquals(1, TestUtils.regexCount(tbl.getContent(), "<w:t>Flamengo</w:t>")); }