Merge remote-tracking branch 'origin/main'

# Conflicts:
#	src/TextOutput.java
This commit is contained in:
amadoste
2021-11-12 11:12:50 +01:00
8 changed files with 108 additions and 64 deletions
-1
View File
@@ -1,7 +1,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
/**
+23 -16
View File
@@ -1,6 +1,7 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
/**
@@ -11,12 +12,14 @@ import java.util.ArrayList;
*/
public class TextTest {
Text txt;
ArrayList<String> stringListe;
/**
* This method is here as a preparation for the test.
*/
@BeforeEach
void setup() {
stringListe = new ArrayList<>();
txt = new Text();
}
@@ -74,33 +77,37 @@ public class TextTest {
/**
* Test methode for Index method
* For TestCase Positiv Testcase One, Three and Four Negativ Testcase Two
*/
@Test
void indexTest() {
ArrayList<String> stringListe;
//Positiv Testcase One, Three and Four Negativ Testcase Two
void indexTestOne() {
txt.add("Word word Test");
txt.add("Word word etc. !!test zweite... Zeile");
txt.add("Lorem ipsum lorem ipsum TEST");
stringListe = txt.index();
Assertions.assertEquals("Word 1, 2",stringListe.get(0));
Assertions.assertEquals("Test 1, 2, 3",stringListe.get(1));
//End of Test
Assertions.assertEquals("Word 1, 2", stringListe.get(0));
Assertions.assertEquals("Test 1, 2, 3", stringListe.get(1));
}
setup();
//Positiv Testcase Two
/**
* Test methode for Index method
* For TestCase Positiv Testcase Two
*/
@Test
void indexTestTwo() {
txt.add("Word word Word Test");
stringListe = txt.index();
Assertions.assertEquals("Word 1",stringListe.get(0));
//End of Test
Assertions.assertEquals("Word 1", stringListe.get(0));
}
setup();
//Negativ Testcase One
/**
* Test methode for Index method
* For TestCase Negativ Testcase One
*/
@Test
void indexTestThree() {
stringListe = txt.index();
Assertions.assertEquals(0,stringListe.size());
Assertions.assertEquals(0, stringListe.size());
}
@Test