Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider 80d2e345 rédigé par Evan JOUBERT's avatar Evan JOUBERT
Parcourir les fichiers

test move validation

parent e6c61ea9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -59,25 +59,18 @@ const moveE4_E8 : Move = move(positionE4, positionE8); ...@@ -59,25 +59,18 @@ const moveE4_E8 : Move = move(positionE4, positionE8);
export class TestCamelMoves { export class TestCamelMoves {
@Setup @Setup
beforeEach() { beforeEach() {
// TODO:
// Initialize an empty chessboard
// Place a white Camel on E4
chessboard = createEmptyChessboard(); chessboard = createEmptyChessboard();
putPiece(chessboard,positionE4,pieces.whiteCamel) putPiece(chessboard,positionE4,pieces.whiteCamel)
} }
@Test("A Camel can move three squares horizontally and one square vertically") @Test("A Camel can move three squares horizontally and one square vertically")
testCanMoveThreeHorizontalAndOneVertical() { testCanMoveThreeHorizontalAndOneVertical() {
// TODO:
// Check the following moves are possible: Expect(isPossible.camelMove(chessboard, moveE4_H3)).toBeTruthy();
// - moveE4_H3
Expect(isPossible.camelMove(chessboard, moveE4_H3)).toBeTruthy();
// - moveE4_H5
Expect(isPossible.camelMove(chessboard, moveE4_H5)).toBeTruthy(); Expect(isPossible.camelMove(chessboard, moveE4_H5)).toBeTruthy();
// - moveE4_B3
Expect(isPossible.camelMove(chessboard, moveE4_B3)).toBeTruthy(); Expect(isPossible.camelMove(chessboard, moveE4_B3)).toBeTruthy();
// - moveE4_B5 Expect(isPossible.camelMove(chessboard, moveE4_B5)).toBeTruthy();
Expect(isPossible.camelMove(chessboard, moveE4_B5)).toBeTruthy();
} }
@Test("A Camel can move three squares vertically and one square horizontally") @Test("A Camel can move three squares vertically and one square horizontally")
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter