|
@ -86,6 +86,20 @@ class testProgramm { |
|
|
assertEquals(1, result, 0); |
|
|
assertEquals(1, result, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testFakultaetWithPositiveNumber() { |
|
|
|
|
|
String input = "5\n"; |
|
|
|
|
|
ByteArrayInputStream in = new ByteArrayInputStream(input.getBytes()); |
|
|
|
|
|
System.setIn(in); |
|
|
|
|
|
|
|
|
|
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
|
|
|
|
|
System.setOut(new PrintStream(out)); |
|
|
|
|
|
|
|
|
|
|
|
FunktionenAusgelagert.Fakultaet(); |
|
|
|
|
|
|
|
|
|
|
|
assertEquals("120\n", out.toString()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|