TextTest.java added test method for txt.index methode
This commit is contained in:
+6
-6
@@ -1,25 +1,25 @@
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
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<String, ArrayList<Integer>> hMap;
|
||||
ArrayList<String> 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() {
|
||||
txt.add("Hallo Hallo zusammen !test!");
|
||||
txt.add("Hallo, wie zusammen");
|
||||
txt.add("Hallo,wie wie zusammen");
|
||||
sListe= txt.index();
|
||||
Assertions.assertEquals("Hallo 1, 2, 3, ",sListe.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user