Browse Source

refactoring: FigureBishopTest

feat-figureMovement
Julius Dewender 9 months ago
parent
commit
90baf93b14
  1. 14
      fh.fd.ci.client/src/test/java/de/fd/fh/FigureBishopTest.java

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

@ -6,6 +6,8 @@ import static org.junit.jupiter.api.Assertions.*;
class FigureBishopTest
{
Figure[] field = new Figure[Figure.fieldLength * Figure.fieldLength];
@Test
void checkInvalidMovesBishopUpward()
{
@ -14,8 +16,7 @@ class FigureBishopTest
int src = Figure.fieldLength * 5 + 5;
int dst = src - Figure.fieldLength;
assertFalse(f.moveAllowed(src, dst,
new Figure[Figure.fieldLength * Figure.fieldLength]));
assertFalse(f.moveAllowed(src, dst, field));
}
@Test
@ -26,8 +27,7 @@ class FigureBishopTest
int src = Figure.fieldLength * 5 + 5;
int dst = src + 1;
assertFalse(f.moveAllowed(src, dst,
new Figure[Figure.fieldLength * Figure.fieldLength]));
assertFalse(f.moveAllowed(src, dst, field));
}
@Test
@ -35,7 +35,9 @@ class FigureBishopTest
{
Figure f = new FigureBishop();
assertFalse(f.moveAllowed(45, 51,
new Figure[64]));
int src = Figure.fieldLength * 5 + 5;
int dst = src + 6;
assertFalse(f.moveAllowed(src, dst, field));
}
}
Loading…
Cancel
Save