public void LocationContainsPieceReturnsFalseForAppropriatePieceTypeAndDifferentProvidedColor1() { var chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var whitePawnPosition = new Position(1, 1); chessboard[whitePawnPosition].Piece = new Pawn(PieceColor.White); Assert.IsFalse(Utilities.LocationContainsPiece <Pawn>(chessboard[whitePawnPosition], PieceColor.Black)); }
public void LocationContainsPieceReturnsFalseForAppropriatePieceTypeAndDifferentProvidedColor2() { var chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var blackBishopPosition = new Position(3, 3); chessboard[blackBishopPosition].Piece = new Bishop(PieceColor.Black); Assert.IsFalse(Utilities.LocationContainsPiece <Bishop>(chessboard[blackBishopPosition], PieceColor.White)); }
public void LocationContainsPieceReturnsFalseForDifferentPieceTypeWithoutProvidingColor1() { var chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var whitePawnPosition = new Position(1, 1); chessboard[whitePawnPosition].Piece = new Pawn(PieceColor.White); Assert.IsFalse(Utilities.LocationContainsPiece <Queen>(chessboard[whitePawnPosition])); }
public void LocationContainsPieceReturnsFalseForDifferentPieceTypeWithoutProvidingColor2() { var chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var blackBishopPosition = new Position(3, 3); chessboard[blackBishopPosition].Piece = new Bishop(PieceColor.Black); Assert.IsFalse(Utilities.LocationContainsPiece <Rook>(chessboard[blackBishopPosition])); }
public void LocationContainsPieceReturnsTrueForAppropriatePieceTypeWithoutProvidingColor2() { var chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var blackBishopPosition = new Position(3, 3); chessboard[blackBishopPosition].Piece = new Bishop(PieceColor.Black); Assert.IsTrue(Utilities.LocationContainsPiece <Bishop>(chessboard[blackBishopPosition])); }
public void PieceIsThreatenedByKingReturnsFalseIfBlackKingIntersectsBlackPiece() { chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var blackPawnPosition = new Position(2, 2); var blackKingPosition = new Position(blackPawnPosition.Row + 1, blackPawnPosition.Column + 1); chessboard[blackPawnPosition].Piece = new Pawn(PieceColor.Black); chessboard[blackKingPosition].Piece = new King(PieceColor.Black); var threatened = chessboard.PieceIsThreatenedByKing(blackPawnPosition); Assert.IsFalse(threatened); }
public void PieceIsThreatenedByQueenReturnsTrueIfWhiteQueenIntersectsBlackPiece() { chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var blackPawnPosition = new Position(2, 2); var whiteQueenPosition = new Position(blackPawnPosition.Row + 2, blackPawnPosition.Column + 2); chessboard[blackPawnPosition].Piece = new Pawn(PieceColor.Black); chessboard[whiteQueenPosition].Piece = new Queen(PieceColor.White); var threatened = chessboard.PieceIsThreatenedByQueen(blackPawnPosition); Assert.IsTrue(threatened); }
public void PieceIsThreatenedByKingReturnsFalseIfWhiteKingIntersectsWhitePiece() { chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var whitePawnPosition = new Position(2, 2); var whiteKingPosition = new Position(whitePawnPosition.Row + 1, whitePawnPosition.Column + 1); chessboard[whitePawnPosition].Piece = new Pawn(PieceColor.White); chessboard[whiteKingPosition].Piece = new King(PieceColor.White); var threatened = chessboard.PieceIsThreatenedByKing(whitePawnPosition); Assert.IsFalse(threatened); }
public void PieceIsThreatenedByBishopsReturnsTrueIfBlackBishopIntersectsWhitePiece() { chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); var whitePawnPosition = new Position(2, 2); var blackBishopPosition = new Position(whitePawnPosition.Row + 2, whitePawnPosition.Column + 2); chessboard[whitePawnPosition].Piece = new Pawn(PieceColor.White); chessboard[blackBishopPosition].Piece = new Bishop(PieceColor.Black); var threatened = chessboard.PieceIsThreatenedByBishops(whitePawnPosition); Assert.IsTrue(threatened); }
public void Setup() { chessboard = ChessboardProvider.GetChessboardClassicWithNoPieces(); }