diff --git a/src/main/html.java b/src/main/html.java index ed81635..056a1c6 100644 --- a/src/main/html.java +++ b/src/main/html.java @@ -9,6 +9,10 @@ public class html { return "<"+tag.getTag()+">"+content+"\n"; } + public String htmlSingleModule(htmlTagsEnum tag){ + return "<"+tag.getTag()+">\n"; + } + public String customContentModule(String tag, String content){ return "<"+tag+">\n"+content+"\n\n"; } @@ -16,4 +20,8 @@ public class html { public String customInlineModule(String tag, String content){ return "<"+tag+">"+content+"\n"; } + + public String customSingleModule(String tag){ + return "<"+tag+">\n"; + } } diff --git a/src/test/htmlTest.java b/src/test/htmlTest.java index f118c31..e928bf1 100644 --- a/src/test/htmlTest.java +++ b/src/test/htmlTest.java @@ -12,22 +12,41 @@ class htmlTest { @Test void htmlContentModuleTest() { - assertEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"content")); - assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"fail")); - assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.PRETAG,"content")); + assertEquals("\ncontent\n\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"content")); + assertNotEquals("\ncontent\n\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"fail")); + assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"content")); } @Test void htmlInlineModuleTest() { - assertEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"content")); - assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"fail")); - assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.PRETAG,"content")); + assertEquals("content\n",html.htmlInlineModule(htmlTagsEnum.TESTTAG,"content")); + assertNotEquals("content\n",html.htmlInlineModule(htmlTagsEnum.TESTTAG,"fail")); + assertNotEquals("content",html.htmlInlineModule(htmlTagsEnum.TESTTAG,"content")); + } + + @Test + void htmlSingleModuleTest(){ + assertEquals("testtag>\n", html.htmlSingleModule(htmlTagsEnum.TESTTAG)); + assertNotEquals("testtag", html.htmlSingleModule(htmlTagsEnum.TESTTAG)); } @Test void customContentModuleTest() { - assertEquals("\ncontent\n",html.customContentModule("testtag","content")); - assertNotEquals("\ncontent\n",html.customContentModule("testtag","fail")); - assertNotEquals("\ncontent\n",html.customContentModule("pretag","content")); + assertEquals("\ncontent\n\n",html.customContentModule("testtag","content")); + assertNotEquals("\ncontent\n\n",html.customContentModule("testtag","fail")); + assertNotEquals("\ncontent\n",html.customContentModule("testtag","content")); + } + + @Test + void customInlineModuleTest() { + assertEquals("content\n",html.customInlineModule("testtag","content")); + assertNotEquals("content\n",html.customInlineModule("testtag","fail")); + assertNotEquals("content",html.customInlineModule("testtag","content")); + } + + @Test + void customSingleModuleTest(){ + assertEquals("testtag>\n", html.customSingleModule("testtag")); + assertNotEquals("testtag", html.customSingleModule("testtag")); } } \ No newline at end of file