Browse Source

test: bishop invalid step 2

feat-figureMovement
Julius Dewender 9 months ago
parent
commit
6e5c52fe37
  1. 2
      fh.fd.ci.client/src/main/java/de/fd/fh/FigureBishop.java
  2. 9
      fh.fd.ci.client/src/test/java/de/fd/fh/FigureBishopTest.java

2
fh.fd.ci.client/src/main/java/de/fd/fh/FigureBishop.java

@ -10,7 +10,7 @@ public class FigureBishop extends Figure
return false;
}
if (dst - src == 1) // 1 Feld nach rechts
if (dst - src == 1 || dst - src == 6) // 1 Feld nach rechts
{
return false;
}

9
fh.fd.ci.client/src/test/java/de/fd/fh/FigureBishopTest.java

@ -29,4 +29,13 @@ class FigureBishopTest
assertFalse(f.moveAllowed(src, dst,
new Figure[Figure.fieldLength * Figure.fieldLength]));
}
@Test
void checkInvalidMovesBishopRight2()
{
Figure f = new FigureBishop();
assertFalse(f.moveAllowed(45, 51,
new Figure[64]));
}
}
Loading…
Cancel
Save