From cd1da5de4a78aeb781d349f48d4fc03dbdfea6ac Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 5 Nov 2021 09:14:26 +0100 Subject: [PATCH] TestClass --- ...ruppe06-hufflepuff-projekt2-texteditor.iml | 16 +++++++++++ .idea/runConfigurations.xml | 10 ------- test/TextTest.java | 27 +++++++++++++++++++ 3 files changed, 43 insertions(+), 10 deletions(-) delete mode 100644 .idea/runConfigurations.xml diff --git a/.idea/gruppe06-hufflepuff-projekt2-texteditor.iml b/.idea/gruppe06-hufflepuff-projekt2-texteditor.iml index e5d2daf..0fb1519 100644 --- a/.idea/gruppe06-hufflepuff-projekt2-texteditor.iml +++ b/.idea/gruppe06-hufflepuff-projekt2-texteditor.iml @@ -8,5 +8,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/test/TextTest.java b/test/TextTest.java index 484ae19..a3018d1 100644 --- a/test/TextTest.java +++ b/test/TextTest.java @@ -1,2 +1,29 @@ +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + public class TextTest { + Text txt; + HashMap> hMap; + ArrayList sListe; + + @BeforeEach + void setup() { + txt = new Text(); + hMap = new HashMap<>(); + sListe = new ArrayList<>(); + sListe.add("Hallo hallo zusammen"); + sListe.add("Hallo wie gehts"); + } + + @Test + void indexTest() { + hMap = txt.index(sListe); + for(Map.Entry> entry : hMap.entrySet()) { + System.out.println("Key: " + entry.getKey() + " Value: " + entry.getValue()); + } + } }