Exemple #1
0
        public void Verify_DiagonalMoveWithNoOtherPieces_ReturnsFalse()
        {
            IChessPiece        rook             = new Rook(0, 5, 5);
            IChessMoveVerifier rookMoveVerifier = new RookMoveVerifier();

            var result = rookMoveVerifier.Verify(rook, 10, 10);

            Assert.False(result);
        }
Exemple #2
0
        public void Verify_ValidDataForMoveWithNoOtherPieces_ReturnsTrue(int finalDestinationColumn, int finalDestinationRow)
        {
            IChessPiece rook = new Rook(0, 0, 0);

            IChessMoveVerifier rookMoveVerifier = new RookMoveVerifier();

            var result = rookMoveVerifier.Verify(rook, finalDestinationColumn, finalDestinationRow);

            Assert.True(result);
        }
Exemple #3
0
        public void Verify_RookAttacksSameColor_ReturnsFalse()
        {
            IChessPiece        rook        = new Rook(0, 5, 5);
            List <IChessPiece> otherPieces = new List <IChessPiece>();

            otherPieces.Add(new Rook(0, 10, 5));

            IChessMoveVerifier rookMoveVerifier = new RookMoveVerifier();

            var result = rookMoveVerifier.Verify(rook, 10, 5, otherPieces);

            Assert.False(result);
        }
Exemple #4
0
        public void Verify_OtherPieceBlocksTheWay(int blockingColumnPosition, int blockingRowPosition,
                                                  int finalDestinationColumn, int finalDestinationRow)
        {
            IChessPiece        rook        = new Rook(0, 5, 5);
            List <IChessPiece> otherPieces = new List <IChessPiece>();

            otherPieces.Add(new Rook(0, blockingColumnPosition, blockingRowPosition));
            otherPieces.Add(new Rook(0, 10, 10));

            IChessMoveVerifier rookMoveVerifier = new RookMoveVerifier();

            var result = rookMoveVerifier.Verify(rook, finalDestinationColumn, finalDestinationRow, otherPieces);

            Assert.False(result);
        }