Commit 5e390757 authored by Théo Winterhalter's avatar Théo Winterhalter
Browse files

Corrige positionC3

Merci Guillaume Paquelet
parent ee24d0d5
...@@ -19,7 +19,7 @@ const positionB3 : Position = position(1, 2) // B3 ...@@ -19,7 +19,7 @@ const positionB3 : Position = position(1, 2) // B3
const positionB5 : Position = position(1, 4) // B5 const positionB5 : Position = position(1, 4) // B5
const positionB6 : Position = position(1, 5) // B6 const positionB6 : Position = position(1, 5) // B6
const positionC3 : Position = position(2, 1) // C3 const positionC3 : Position = position(2, 2) // C3
const positionC4 : Position = position(2, 3) // C4 const positionC4 : Position = position(2, 3) // C4
const positionC5 : Position = position(2, 4) // C5 const positionC5 : Position = position(2, 4) // C5
const positionC6 : Position = position(2, 5) // C6 const positionC6 : Position = position(2, 5) // C6
...@@ -91,28 +91,28 @@ export class TestBlackPawnMoves { ...@@ -91,28 +91,28 @@ export class TestBlackPawnMoves {
testPawnCanMoveForward() { testPawnCanMoveForward() {
putPiece(chessboard, positionA7, pieces.blackPawn); putPiece(chessboard, positionA7, pieces.blackPawn);
let singleForward: Move = {from: positionA7, to: positionA6, isValid: true}; let singleForward: Move = {from: positionA7, to: positionA6, isValid: true};
Expect(isPossible.blackPawnMove(chessboard, singleForward)).toBeTruthy(); Expect(isPossible.blackPawnMove(chessboard, singleForward)).toBeTruthy();
} }
@Test("Pawns cannot move backward") @Test("Pawns cannot move backward")
testPawnCannotMoveBackward() { testPawnCannotMoveBackward() {
putPiece(chessboard, positionA7, pieces.blackPawn); putPiece(chessboard, positionA7, pieces.blackPawn);
let singleForward: Move = {from: positionA7, to: positionA8, isValid: true}; let singleForward: Move = {from: positionA7, to: positionA8, isValid: true};
Expect(isPossible.blackPawnMove(chessboard, singleForward)).not.toBeTruthy(); Expect(isPossible.blackPawnMove(chessboard, singleForward)).not.toBeTruthy();
} }
@Test("When in the initial position, paws can move 2 squares forward") @Test("When in the initial position, paws can move 2 squares forward")
testPawnInitialMove() { testPawnInitialMove() {
putPiece(chessboard, positionA7, pieces.blackPawn); putPiece(chessboard, positionA7, pieces.blackPawn);
let doubleForward: Move = {from: positionA7, to: positionA5, isValid: true}; let doubleForward: Move = {from: positionA7, to: positionA5, isValid: true};
Expect(isPossible.blackPawnMove(chessboard, doubleForward)).toBeTruthy(); Expect(isPossible.blackPawnMove(chessboard, doubleForward)).toBeTruthy();
} }
@Test("When a paws has already moved, it cannot move 2 squares forward") @Test("When a paws has already moved, it cannot move 2 squares forward")
testCannotMoveTwoSquaresIfAlreadyMoved() { testCannotMoveTwoSquaresIfAlreadyMoved() {
putPiece(chessboard, positionC6, pieces.blackPawn); putPiece(chessboard, positionC6, pieces.blackPawn);
let doubleForward: Move = {from: positionC6, to: positionC4, isValid: true} let doubleForward: Move = {from: positionC6, to: positionC4, isValid: true}
Expect(isPossible.blackPawnMove(chessboard, doubleForward)).not.toBeTruthy(); Expect(isPossible.blackPawnMove(chessboard, doubleForward)).not.toBeTruthy();
} }
@Test("When in the initial position, pawns cannot move 3 squares forward") @Test("When in the initial position, pawns cannot move 3 squares forward")
...@@ -130,7 +130,7 @@ export class TestBlackPawnMoves { ...@@ -130,7 +130,7 @@ export class TestBlackPawnMoves {
Expect(isPossible.blackPawnMove(chessboard, singleForward)).not.toBeTruthy(); Expect(isPossible.blackPawnMove(chessboard, singleForward)).not.toBeTruthy();
} }
@Test("Pawns cannot capture an empty square ") @Test("Pawns cannot capture an empty square ")
testPawnCannotCaptureEmptySquare() { testPawnCannotCaptureEmptySquare() {
putPiece(chessboard, positionA7, pieces.blackPawn); putPiece(chessboard, positionA7, pieces.blackPawn);
let diagonalCapture: Move = {from: positionA7, to: positionB6, isValid: true} let diagonalCapture: Move = {from: positionA7, to: positionB6, isValid: true}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment