|
|
@ -0,0 +1,29 @@ |
|
|
|
package digital.technik; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.PrintStream; |
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue; |
|
|
|
|
|
|
|
|
|
|
|
class DigitalTechnikTest { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
public void testDigitalTechnik1() { |
|
|
|
String input = "3\n"; |
|
|
|
ByteArrayInputStream in = new ByteArrayInputStream(input.getBytes()); |
|
|
|
System.setIn(in); |
|
|
|
|
|
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
|
|
|
System.setOut(new PrintStream(out)); |
|
|
|
|
|
|
|
DigitalTechnik digitalTechnik = new DigitalTechnik(); |
|
|
|
digitalTechnik.digitalTechnik1(); |
|
|
|
|
|
|
|
assertTrue(out.toString().contains("Die Zuordnung muss nicht (eindeutig) umkehrbar sein!")); |
|
|
|
} |
|
|
|
} |