2021-11-05 12:03:27 +01:00
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
2021-11-09 20:54:54 +01:00
|
|
|
|
2021-11-05 12:03:27 +01:00
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2021-11-12 11:11:03 +01:00
|
|
|
/**
|
|
|
|
* New class TextOutputTest
|
|
|
|
* This class is here to test the class TextOutput and to test the console output of that class.
|
|
|
|
* Author: Leonardo Brandenberger
|
|
|
|
* Date: 12.11.2021
|
|
|
|
*/
|
2021-11-05 12:03:27 +01:00
|
|
|
class TextOutputTest {
|
|
|
|
TextOutput textOutput;
|
|
|
|
ArrayList<String> text;
|
|
|
|
|
2021-11-12 11:11:03 +01:00
|
|
|
/**
|
|
|
|
* This method is here as a preparation for the test.
|
|
|
|
*/
|
2021-11-05 12:03:27 +01:00
|
|
|
@BeforeEach
|
2021-11-08 20:45:44 +01:00
|
|
|
public void setup() {
|
2021-11-05 12:03:27 +01:00
|
|
|
textOutput = new TextOutput();
|
2021-11-09 20:54:54 +01:00
|
|
|
textOutput.formatFix(20);
|
2021-11-05 12:03:27 +01:00
|
|
|
text = new ArrayList<>();
|
2021-11-09 20:54:54 +01:00
|
|
|
text.add("Virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, septentr ionesimmensoslongusw ordos.");
|
|
|
|
text.add("Virtutedasjdhashdkjhakjdhakdshjkashd praecedunt, quod fere cotidianis proeliis cum");
|
2021-11-11 21:49:39 +01:00
|
|
|
text.add("1234");
|
2021-11-09 20:54:54 +01:00
|
|
|
text.add("12417575147517845 445264565");
|
|
|
|
text.add(" ");
|
2021-11-05 12:03:27 +01:00
|
|
|
}
|
|
|
|
|
2021-11-12 11:11:03 +01:00
|
|
|
/**
|
|
|
|
* This method is the test to show if the console output works as we expect it to.
|
|
|
|
*/
|
2021-11-05 12:03:27 +01:00
|
|
|
@Test
|
2021-11-08 20:45:44 +01:00
|
|
|
public void print() {
|
|
|
|
textOutput.print(text);
|
2021-11-11 15:53:51 +01:00
|
|
|
System.out.println("fertig");
|
|
|
|
textOutput.formatRaw();
|
|
|
|
textOutput.print(text);
|
|
|
|
System.out.println("fertig");
|
2021-11-05 12:03:27 +01:00
|
|
|
}
|
|
|
|
}
|