From 1f50e17cfcadbc513c7e206d7aeb41bb084ae901 Mon Sep 17 00:00:00 2001 From: jannisfingerhut Date: Fri, 10 Feb 2023 23:23:49 +0100 Subject: [PATCH] #33 UnitTest erweitert --- LernProgramm/testProgramm.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/LernProgramm/testProgramm.java b/LernProgramm/testProgramm.java index a8be895..e1a9152 100644 --- a/LernProgramm/testProgramm.java +++ b/LernProgramm/testProgramm.java @@ -101,6 +101,18 @@ class testProgramm { } +@Test + public void testFakultaetWithZero() { + String input = "0\n"; + ByteArrayInputStream in = new ByteArrayInputStream(input.getBytes()); + System.setIn(in); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + System.setOut(new PrintStream(out)); + + FunktionenAusgelagert.Fakultaet(); + + assertTrue(true);