public void Equals_TwoBoardsWithExactlyTheSameConfiguration_ReturnsTrue() { Board board1 = new Board(); Board board2 = new Board(); board1.Setup(); board2.Setup(); Assert.AreEqual(board1, board2); board1.Move(board1.GetSquare(1, 2), board1.GetSquare(1, 4)); board2.Move(board2.GetSquare(1, 2), board2.GetSquare(1, 4)); Assert.AreEqual(board1, board2); }
private Position SimulateMove(Square origin, Square destination) { var simulationBoard = new Board(); foreach (var square in _allSquares) simulationBoard.SetSquare(square.File, square.Rank, square.Occupier.Clone(simulationBoard)); simulationBoard.Move(simulationBoard.GetSquare(origin.File, origin.Rank), simulationBoard.GetSquare(destination.File, destination.Rank)); return simulationBoard.GetPosition(); }