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.

42 lines
1.0 KiB

  1. package de.fd.fh;
  2. import org.junit.jupiter.api.Test;
  3. import static org.junit.jupiter.api.Assertions.*;
  4. class FigureTest
  5. {
  6. @Test
  7. void checkMoveWithInvalidFieldSmall() // Feldgröße sollte 8*8 betragen
  8. {
  9. Figure f = new Figure();
  10. assertFalse(f.moveAllowed(0,0, new int[0]));
  11. }
  12. @Test
  13. void checkMoveWithInvalidFieldBigger() // Feldgröße sollte 8*8 betragen
  14. {
  15. Figure f = new Figure();
  16. assertFalse(f.moveAllowed(48,40, new int[8*9]));
  17. }
  18. @Test
  19. void checkMoveWithInvalidFieldCorrect() // Feldgröße sollte 8*8 betragen
  20. {
  21. Figure f = new Figure();
  22. assertTrue(f.moveAllowed(48,40, new int[Figure.fieldSize]));
  23. }
  24. @Test
  25. void checkMoveWithoutNewDestination()
  26. {
  27. Figure f = new Figure();
  28. assertFalse(f.moveAllowed(48,48, new int[Figure.fieldSize]));
  29. }
  30. @Test
  31. void checkMoveWithValidDestination()
  32. {
  33. Figure f = new Figure();
  34. assertTrue(f.moveAllowed(48,40, new int[Figure.fieldSize]));
  35. }
  36. }