/*** * @param The value of the paragraph * @return the Fluent @Heading2 */ public static Heading3 with(String string) { return new Heading3(string); }
@Test public void testH3Fluent(){ Heading3 h3 = Heading3.with("h3").create(); assertEquals(1, TestUtils.regexCount(h3.getContent(), "<w:p wsp:rsidR*")); assertEquals(1, TestUtils.regexCount(h3.getContent(), "<w:t>h3</w:t>")); assertEquals(1, TestUtils.regexCount(h3.getContent(), "</w:p>")); assertEquals(1, TestUtils.regexCount(h3.getContent(), "<w:pStyle w:val=\"Heading3\" />")); }
@Test public void testH3(){ Heading3 h3 = Heading3.with("h3"); assertEquals(1, TestUtils.regexCount(h3.getContent(), "<w:p wsp:rsidR*")); assertEquals(1, TestUtils.regexCount(h3.getContent(), "<w:t>h3</w:t>")); assertEquals(1, TestUtils.regexCount(h3.getContent(), "</w:p>")); assertEquals(1, TestUtils.regexCount(h3.getContent(), "<w:pStyle w:val=\"Heading3\" />")); }
@Test public void testFluent(){ Heading1 h1 = (Heading1) Heading1.with("h111").withStyle().bold().italic().align(HeadingStyle.Align.CENTER).create(); Heading2 h2 = (Heading2) Heading2.with("h222").withStyle().bold().italic().align(HeadingStyle.Align.CENTER).create(); Heading3 h3 = (Heading3) Heading3.with("h222").withStyle().bold().italic().align(HeadingStyle.Align.CENTER).create(); verifyStyles(h1); verifyStyles(h2); verifyStyles(h3); }
@Test public void testEmpty(){ Heading1 h1 = Heading1.with(""); assertEquals("", h1.getContent()); Heading2 h2 = Heading2.with(""); assertEquals("", h2.getContent()); Heading3 h3 = Heading3.with(""); assertEquals("", h3.getContent()); }
/*** * @param The value of the paragraph * @return the Fluent @Heading2 */ public static Heading3 with(String string) { return new Heading3(string); }