diff --git a/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java b/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java index 3b3815d..724aaac 100644 --- a/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java +++ b/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java @@ -4,6 +4,11 @@ public class Figure { public boolean moveAllowed(int src, int dst, int[] field) { + if (field.length == 8*8) + { + return true; + } + return false; } } diff --git a/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java b/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java index 476968a..fdadc15 100644 --- a/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java +++ b/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java @@ -19,4 +19,11 @@ class FigureTest Figure f = new Figure(); assertFalse(f.moveAllowed(0,0, new int[8*9])); } + + @Test + void checkMoveWithInvalidFieldCorrect() // Feldgröße sollte 8*8 betragen + { + Figure f = new Figure(); + assertTrue(f.moveAllowed(0,0, new int[8*8])); + } } \ No newline at end of file