|
@ -11,41 +11,53 @@ class FigureRookTest |
|
|
void whiteRookValidMoveUp() |
|
|
void whiteRookValidMoveUp() |
|
|
{ |
|
|
{ |
|
|
Figure f = new FigureRook(); |
|
|
Figure f = new FigureRook(); |
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 0 + 4, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
|
|
|
|
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 4 + 4, |
|
|
|
|
|
Figure.fieldLength * 0 + 4, |
|
|
|
|
|
new Figure[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void whiteRookValidMoveDown() |
|
|
void whiteRookValidMoveDown() |
|
|
{ |
|
|
{ |
|
|
Figure f = new FigureRook(); |
|
|
Figure f = new FigureRook(); |
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 7 + 4, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
|
|
|
|
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 4 + 4, |
|
|
|
|
|
Figure.fieldLength * 7 + 4, |
|
|
|
|
|
new Figure[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void whiteRookInvalidMoveLeftUp() // diagonal nach links oben |
|
|
void whiteRookInvalidMoveLeftUp() // diagonal nach links oben |
|
|
{ |
|
|
{ |
|
|
Figure f = new FigureRook(); |
|
|
Figure f = new FigureRook(); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 3 + 3, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, |
|
|
|
|
|
Figure.fieldLength * 3 + 3, |
|
|
|
|
|
new Figure[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void whiteRookInvalidMoveRightUp() // diagonal nach rechts oben |
|
|
void whiteRookInvalidMoveRightUp() // diagonal nach rechts oben |
|
|
{ |
|
|
{ |
|
|
Figure f = new FigureRook(); |
|
|
Figure f = new FigureRook(); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 3 + 5, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, |
|
|
|
|
|
Figure.fieldLength * 3 + 5, |
|
|
|
|
|
new Figure[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void whiteRookInvalidMoveLeftDown() // diagonal nach links unten |
|
|
void whiteRookInvalidMoveLeftDown() // diagonal nach links unten |
|
|
{ |
|
|
{ |
|
|
Figure f = new FigureRook(); |
|
|
Figure f = new FigureRook(); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 5 + 3, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, |
|
|
|
|
|
Figure.fieldLength * 5 + 3, |
|
|
|
|
|
new Figure[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void whiteRookInvalidMoveRightDown() // diagonal nach rechts unten |
|
|
void whiteRookInvalidMoveRightDown() // diagonal nach rechts unten |
|
|
{ |
|
|
{ |
|
|
Figure f = new FigureRook(); |
|
|
Figure f = new FigureRook(); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 5 + 5, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, |
|
|
|
|
|
Figure.fieldLength * 5 + 5, |
|
|
|
|
|
new Figure[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |