43 lines
1.2 KiB
Java
43 lines
1.2 KiB
Java
import org.junit.jupiter.api.BeforeEach;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
class TextOutputTest {
|
|
TextOutput textOutput;
|
|
ArrayList<String> text;
|
|
|
|
/**
|
|
* This method is here as a preparation for the test.
|
|
*/
|
|
@BeforeEach
|
|
public void setup() {
|
|
textOutput = new TextOutput();
|
|
textOutput.formatFix(20);
|
|
text = new ArrayList<>();
|
|
text.add("Virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, septentr ionesimmensoslongusw ordos.");
|
|
text.add("Virtutedasjdhashdkjhakjdhakdshjkashd praecedunt, quod fere cotidianis proeliis cum");
|
|
text.add("1234");
|
|
text.add("12417575147517845 445264565");
|
|
text.add(" ");
|
|
}
|
|
|
|
/**
|
|
* This method is the test to show if the console output works as we expect it to.
|
|
*/
|
|
@Test
|
|
public void print() {
|
|
textOutput.print(text);
|
|
System.out.println("fertig");
|
|
textOutput.formatRaw();
|
|
textOutput.print(text);
|
|
System.out.println("fertig");
|
|
}
|
|
} |