Browse Source

figure movement field check (expected size)

feat-figureMovement
JD 4 years ago
parent
commit
c20e2e364a
  1. 5
      fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java
  2. 7
      fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java

5
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;
}
}

7
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]));
}
}
Loading…
Cancel
Save