You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
639 B

  1. package de.fd.fh;
  2. import org.junit.jupiter.api.Test;
  3. import static org.junit.jupiter.api.Assertions.*;
  4. class FigureKingTest
  5. {
  6. // K = Position (19), x = gültig (10, 11, 12, 18, 20, 26, 27, 28), rest nicht
  7. // x x x
  8. // x K x
  9. // x x x
  10. @Test
  11. void checkInvalidKingMoves()
  12. {
  13. Figure f = new FigureKing();
  14. for (int i = 0; i < 64; i++)
  15. {
  16. if (i != 10 && i != 11 && i != 12
  17. && i != 18 && i != 20
  18. && i != 26 && i != 27 && i != 28)
  19. {
  20. assertFalse(f.moveAllowed(19, i, new Figure[64]));
  21. }
  22. }
  23. }
  24. }