|
@ -6,6 +6,8 @@ import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
|
class FigureBishopTest |
|
|
class FigureBishopTest |
|
|
{ |
|
|
{ |
|
|
|
|
|
Figure[] field = new Figure[Figure.fieldLength * Figure.fieldLength]; |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void checkInvalidMovesBishopUpward() |
|
|
void checkInvalidMovesBishopUpward() |
|
|
{ |
|
|
{ |
|
@ -14,8 +16,7 @@ class FigureBishopTest |
|
|
int src = Figure.fieldLength * 5 + 5; |
|
|
int src = Figure.fieldLength * 5 + 5; |
|
|
int dst = src - Figure.fieldLength; |
|
|
int dst = src - Figure.fieldLength; |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(src, dst, |
|
|
|
|
|
new Figure[Figure.fieldLength * Figure.fieldLength])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(src, dst, field)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
@ -26,8 +27,7 @@ class FigureBishopTest |
|
|
int src = Figure.fieldLength * 5 + 5; |
|
|
int src = Figure.fieldLength * 5 + 5; |
|
|
int dst = src + 1; |
|
|
int dst = src + 1; |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(src, dst, |
|
|
|
|
|
new Figure[Figure.fieldLength * Figure.fieldLength])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(src, dst, field)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
@ -35,7 +35,9 @@ class FigureBishopTest |
|
|
{ |
|
|
{ |
|
|
Figure f = new FigureBishop(); |
|
|
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)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |