예제 #1
0
        public void PieceIsThreatenedByBishopsReturnsFalseIfBlackBishopIntersectsBlackPiece()
        {
            chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces();

            var blackPawnPosition   = new Position(2, 2);
            var blackBishopPosition = new Position(blackPawnPosition.Row + 2, blackPawnPosition.Column + 2);

            chessboard[blackPawnPosition].Piece   = new Pawn(PieceColor.Black);
            chessboard[blackBishopPosition].Piece = new Bishop(PieceColor.Black);

            var threatened = chessboard.PieceIsThreatenedByBishops(blackPawnPosition);

            Assert.IsFalse(threatened);
        }
예제 #2
0
        public void PieceIsThreatenedByBishopsReturnsFalseIfWhiteBishopIntersectsWhitePiece()
        {
            chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces();

            var whitePawnPosition   = new Position(2, 2);
            var whiteBishopPosition = new Position(whitePawnPosition.Row + 2, whitePawnPosition.Column + 2);

            chessboard[whitePawnPosition].Piece   = new Pawn(PieceColor.White);
            chessboard[whiteBishopPosition].Piece = new Bishop(PieceColor.White);

            var threatened = chessboard.PieceIsThreatenedByBishops(whitePawnPosition);

            Assert.IsFalse(threatened);
        }