diff --git a/tests/de/hsmannheim/informatik/name/domain/starwars/ThinkTest.java b/tests/de/hsmannheim/informatik/name/domain/starwars/ThinkTest.java index 4d461cb..7fc0f2b 100644 --- a/tests/de/hsmannheim/informatik/name/domain/starwars/ThinkTest.java +++ b/tests/de/hsmannheim/informatik/name/domain/starwars/ThinkTest.java @@ -11,6 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; class ThinkTest { private final R2D2 r2d2 = new R2D2(9999, "test"); + private final C3PO c3po = new C3PO(19999, "test"); ThinkTest() throws RobotIllegalStateException { } @@ -40,6 +41,27 @@ class ThinkTest { void thinkTestMagicNumberException() { assertThrows(RobotMagicValueException.class, () -> r2d2.think(new int[]{42})); } + @Test + void thinkTestStandardC3PO() throws RobotException { + assertArrayEquals(new int[]{5, 4, 3, 2, 1, 0}, c3po.think(new int[]{3, 0, 1, 5, 2, 4})); + } + + @Test + void thinkTestNegativeC3PO() throws RobotException { + assertArrayEquals(new int[]{3, 2, 1, 0, -1, -2, -3}, c3po.think(new int[]{0, -3, 2, -1, 1, 3, -2})); + } + @Test + void thinkTestZerosC3PO() throws RobotException { + assertArrayEquals(new int[]{0, 0, 0, 0}, c3po.think(new int[]{0, 0, 0, 0})); + } + @Test + void thinkTestEmptyC3PO() throws RobotException { + assertArrayEquals(new int[]{}, c3po.think(new int[]{})); + } + @Test + void thinkTestMagicNumberExceptionC3PO(){ + assertThrows(RobotMagicValueException.class, () -> c3po.think(new int[]{42})); + } }