From a7dd881817adb8c4d675694850a6b62232a01b68 Mon Sep 17 00:00:00 2001 From: Philipp3107 Date: Tue, 10 Jan 2023 00:41:27 +0100 Subject: [PATCH] =?UTF-8?q?Fehlermeldung=20angepasst=20und=20in=20Tests=20?= =?UTF-8?q?erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../robot_exceptions/robotExceptions.java | 2 +- tests/tests/C3POTest.java | 6 ++--- tests/tests/FactoryTest.java | 26 +++++++++++++++++++ tests/tests/R2D2Test.java | 2 +- 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 tests/tests/FactoryTest.java diff --git a/src/utility/robot_exceptions/robotExceptions.java b/src/utility/robot_exceptions/robotExceptions.java index 0ba3351..b5e0083 100644 --- a/src/utility/robot_exceptions/robotExceptions.java +++ b/src/utility/robot_exceptions/robotExceptions.java @@ -3,7 +3,7 @@ package src.utility.robot_exceptions; public enum robotExceptions { ILLEGALSTATE("ist in einem illegalen Zustand"), MAGICVALUE("Magic value"), - EMPTYARRAY("leer"); + EMPTYARRAY("hat ein leeres Array bekommen."); final String message; diff --git a/tests/tests/C3POTest.java b/tests/tests/C3POTest.java index aff3419..afb5d42 100644 --- a/tests/tests/C3POTest.java +++ b/tests/tests/C3POTest.java @@ -61,7 +61,7 @@ class C3POTest { try{ String solution = c3po.speak(new int[]{}); }catch(RobotException re){ - assertEquals(0, "r2d2 leer".compareTo(re.getMessage())); + assertEquals(0, "r2d2 hat ein leeres Array bekommen.".compareTo(re.getMessage())); } } @@ -151,7 +151,7 @@ class C3POTest { @Test void arrayEmptyException(){ - String expectedMessage = "Herbert leer"; + String expectedMessage = "Herbert hat ein leeres Array bekommen."; try{ int[] solution = c3po.think(new int[0]); }catch(RobotException re){ @@ -166,7 +166,7 @@ class C3POTest { } @Test void testExceptionHistory() { - String expectedMessage = "Herbert leer"; + String expectedMessage = "Herbert hat ein leeres Array bekommen."; try{ int[] solution = c3po.think(new int[0]); }catch(RobotException re){ diff --git a/tests/tests/FactoryTest.java b/tests/tests/FactoryTest.java new file mode 100644 index 0000000..c0f99d7 --- /dev/null +++ b/tests/tests/FactoryTest.java @@ -0,0 +1,26 @@ +package tests.tests; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class FactoryTest { + + @Test + void robotListToCollection() { + + } + + @Test + void getRobotList() { + + } + + @Test + void buildNewRobot() { + } + + @Test + void getRobotOfList() { + } +} \ No newline at end of file diff --git a/tests/tests/R2D2Test.java b/tests/tests/R2D2Test.java index 29bb38e..be9a0a1 100644 --- a/tests/tests/R2D2Test.java +++ b/tests/tests/R2D2Test.java @@ -48,7 +48,7 @@ class R2D2Test { try{ String solution = r2d2.speak(new int[]{}); }catch(RobotException re){ - assertEquals(0, "r2d2 leer".compareTo(re.getMessage())); + assertEquals(0, "r2d2 hat ein leeres Array bekommen.".compareTo(re.getMessage())); } }