public void Equals_TwoOppositeColorRooks_AreNotEqual() { Rook rook1 = new Rook(new Board(), PieceColor.White); Rook rook2 = new Rook(new Board(), PieceColor.Black); Assert.AreNotEqual(rook1, rook2); }
public void Equals_TwoSameColorRooks_AreEqual() { Rook rook1 = new Rook(new Board(), PieceColor.White); Rook rook2 = new Rook(new Board(), PieceColor.White); Rook rook3 = new Rook(new Board(), PieceColor.Black); Rook rook4 = new Rook(new Board(), PieceColor.Black); Assert.AreEqual(rook1, rook2); Assert.AreEqual(rook3, rook4); }
public void Setup_WhenBoardIsSetup_FirstAndEightFilePositionsOnTheFirstRankReturnWhiteRooks() { var expected = new Rook(Board, PieceColor.White); Board.Setup(); Assert.AreEqual(expected, GetSquare(1, 1).Occupier); Assert.AreEqual(expected, GetSquare(8, 1).Occupier); }
public void Move_WhiteKingMakesQueensideCastlingMove_QueensideRookIsMovedToKingsRightsidePosition() { var expected = new Rook(Board, PieceColor.White); Board.SetSquare(5, 1, new King(Board, PieceColor.White)); Board.SetSquare(1, 1, expected); Board.Move(GetSquare(5, 1), GetSquare(3, 1)); var actual = GetSquare(4, 1).Occupier; Assert.AreEqual(expected, actual); }
public void Move_WhiteKingMakesKingsideCastlingMove_QueensideRookIsNotMoved() { var expected = new Rook(Board, PieceColor.White); Board.SetSquare(5, 1, new King(Board, PieceColor.White)); Board.SetSquare(8, 1, new Rook(Board, PieceColor.White)); Board.SetSquare(1, 1, expected); Board.Move(GetSquare(5, 1), GetSquare(7, 1)); var actual = GetSquare(1, 1).Occupier; Assert.AreEqual(expected, actual); }
public void Move_BlackKingMakesQueensideCastlingMove_QueensideRookIsMoveToKingsLeftsidePosition() { var expected = new Rook(Board, PieceColor.Black); Board.SetSquare(5, 8, new King(Board, PieceColor.Black)); Board.SetSquare(1, 8, expected); Board.Move(GetSquare(5, 8), GetSquare(3, 8)); var actual = GetSquare(4, 8).Occupier; Assert.AreEqual(expected, actual); }
public void Move_BlackKingMakesQueensideCastlingMove_KingsideRookIsNotMoved() { var expected = new Rook(Board, PieceColor.White); Board.SetSquare(5, 8, new King(Board, PieceColor.White)); Board.SetSquare(1, 8, new Rook(Board, PieceColor.White)); Board.SetSquare(8, 8, expected); Board.Move(GetSquare(5, 8), GetSquare(3, 8)); var actual = GetSquare(8, 8).Occupier; Assert.AreEqual(expected, actual); }
public void Move_BlackKingMakesKingsideCastlingMove_KingsideRookIsMovedToKingsRightsidePosition() { var expected = new Rook(Board, PieceColor.Black); Board.SetSquare(5, 8, new King(Board, PieceColor.Black)); Board.SetSquare(8, 8, expected); Board.Move(GetSquare(5, 8), GetSquare(7, 8)); var actual = GetSquare(6, 8).Occupier; Assert.AreEqual(expected, actual); }