public void _10_making_an_illegal_move_by_placing_the_black_pawn_on_X_equals_6_and_Y_equals_3_and_moving_to_X_equals_7_and_Y_equals_3_should_not_move_the_pawn() { _chessBoard.Add(_pawn, 6, 3, PieceColor.Black); _pawn.Move(MovementType.Move, 7, 3); Assert.That(_pawn.XCoordinate, Is.EqualTo(6)); Assert.That(_pawn.YCoordinate, Is.EqualTo(3)); }
public void _10_making_an_illegal_move_by_placing_the_white_pawn_on_X_equals_6_and_Y_eqauls_1_and_moving_to_X_equals_7_and_Y_eqauls_2_should_not_move_the_pawn() { _chessBoard.Add(_pawn, 6, 1, PieceColor.White); _pawn.Move(MovementType.Move, 7, 2); Assert.That(_pawn.XCoordinate, Is.EqualTo(6)); Assert.That(_pawn.YCoordinate, Is.EqualTo(1)); }
public void _01_white_pawn_capture_black_pawn_at_row_5_col_2() { _chessBoard.AddReplace(_pawn2, 5, 2); _chessBoard.AddReplace(_pawn1, 6, 1); _pawn1.Move(5, 2); Assert.That(_pawn1.Row, Is.EqualTo(5)); Assert.That(_pawn1.Column, Is.EqualTo(2)); Assert.That(_chessBoard.GetPiece(5, 2), Is.EqualTo(_pawn1)); }
public void _black_pawn_blocked_by_another_black_pawn() { //Pawn cant move to occupied space when moving forward _chessBoard.AddReplace(_pawn, 1, 3); var blockingPawn = new Pawn(PieceColor.Black, _chessBoard); _chessBoard.AddReplace(blockingPawn, 2, 3); _pawn.Move(2, 3); Assert.That(_pawn.Row, Is.EqualTo(1)); Assert.That(_pawn.Column, Is.EqualTo(3)); }
public void _10_white_pawn_en_passant_to_2_2() { //Black pawn must move double on the first move for white to en-passant _chessBoard.AddReplace(_pawn2, 1, 2); _pawn2.Move(3, 2); _chessBoard.AddReplace(_pawn1, 3, 3); _pawn1.Move(2, 2); Assert.That(_pawn1.Row, Is.EqualTo(2)); Assert.That(_pawn1.Column, Is.EqualTo(2)); Assert.That(_chessBoard.GetPiece(1, 2), Is.EqualTo(null)); Assert.That(_chessBoard.GetPiece(3, 2), Is.EqualTo(null)); }