From 8baea9f14044a0f6aedfabef7cf7f25f4a90401b Mon Sep 17 00:00:00 2001 From: schrom01 Date: Wed, 10 Nov 2021 13:55:59 +0100 Subject: [PATCH] added Test Method for add and dummy method in TextTest.java --- test/TextTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/TextTest.java b/test/TextTest.java index d8e2190..64516be 100644 --- a/test/TextTest.java +++ b/test/TextTest.java @@ -14,6 +14,25 @@ public class TextTest { txt = new Text(); } + /** + * Test Method for add and dummy methods + */ + @Test + void addTest() { + Assertions.assertEquals(0, txt.getText().size()); + Assertions.assertEquals(false, txt.add(1, "test")); + Assertions.assertEquals(false, txt.dummy(1)); + Assertions.assertEquals(0, txt.getText().size()); + Assertions.assertEquals(true, txt.add("test1")); + Assertions.assertEquals(true, txt.add(1, "test2")); + Assertions.assertEquals("test2", txt.getText().get(0)); + Assertions.assertEquals("test1", txt.getText().get(1)); + Assertions.assertEquals(true, txt.dummy(2)); + Assertions.assertEquals(true, txt.dummy()); + Assertions.assertEquals(true, txt.getText().get(1).equals(txt.getText().get(3))); + Assertions.assertEquals(4, txt.getText().size()); + } + @Test void indexTest() { txt.add("Hallo ?Hallo> zusammen !test!");