Beispiel #1
0
 public void _02_making_a_legal_move_by_placing_the_black_king_on_X_equals_4_and_Y_eqauls_7_and_moving_to_X_equals_4_and_Y_eqauls_6_should_move_the_king()
 {
     _chessBoard.Add(_blackKing, 4, 7);
     _blackKing.Move(4, 6);
     Assert.That(_blackKing.XCoordinate, Is.EqualTo(4));
     Assert.That(_blackKing.YCoordinate, Is.EqualTo(6));
     Assert.That(_chessBoard.IsPieceAt(4, 6, _blackKing), Is.True);
 }
Beispiel #2
0
 public void _11_tries_to_takes_enemy_pawn_with_En_Passant_but_has_waited_too_long()
 {
     _chessBoard.Add(_blackPawn, 2, 6);
     _chessBoard.Add(_whitePawn, 3, 4);
     _blackPawn.Move(2, 4);
     _whiteKing.Move(4, 1);
     _blackKing.Move(5, 7);
     _whitePawn.Move(2, 5);
     Assert.That(!_chessBoard.IsPieceAt(2, 5, _whitePawn));
     Assert.That(_chessBoard.IsPieceAt(2, 4, _blackPawn));
     Assert.That(!_chessBoard.CapturedBlackPieces.Contains(_blackPawn));
 }
Beispiel #3
0
 public void _11_tries_to_takes_enemy_pawn_with_En_Passant_but_has_waited_too_long()
 {
     _chessBoard.Add(_blackPawn, 2, 3);
     _chessBoard.Add(_whitePawn, 3, 1);
     _whitePawn.Move(3, 3);
     _blackKing.Move(4, 6);
     _whiteKing.Move(4, 1);
     _blackPawn.Move(3, 2);
     Assert.That(_chessBoard.IsPieceAt(3, 3, _whitePawn));
     Assert.That(!_chessBoard.IsPieceAt(3, 2, _blackPawn));
     Assert.That(_blackPawn.XCoordinate, Is.EqualTo(2));
     Assert.That(_blackPawn.YCoordinate, Is.EqualTo(3));
     Assert.That(!_chessBoard.CapturedWhitePieces.Contains(_whitePawn));
 }