public void Avoids_Duplicate_Positioning() { Pawn firstPawn = new Pawn(PieceColor.Black); Pawn secondPawn = new Pawn(PieceColor.Black); _chessBoard.Add(firstPawn, 6, 3, PieceColor.Black); _chessBoard.Add(secondPawn, 6, 3, PieceColor.Black); Assert.That(firstPawn.XCoordinate, Is.EqualTo(6)); Assert.That(firstPawn.YCoordinate, Is.EqualTo(3)); Assert.That(secondPawn.XCoordinate, Is.EqualTo(-1)); Assert.That(secondPawn.YCoordinate, Is.EqualTo(-1)); }
public void Limits_The_Number_Of_Pawns() { for (int i = 0; i < 10; i++) { Pawn pawn = new Pawn(PieceColor.Black); int row = i / ChessBoard.MaxBoardWidth; _chessBoard.Add(pawn, 6 + row, i % ChessBoard.MaxBoardWidth, PieceColor.Black); if (row < 1) { Assert.That(pawn.XCoordinate, Is.EqualTo(6 + row)); Assert.That(pawn.YCoordinate, Is.EqualTo(i % ChessBoard.MaxBoardWidth)); } else { Assert.That(pawn.XCoordinate, Is.EqualTo(-1)); Assert.That(pawn.YCoordinate, Is.EqualTo(-1)); } } }
public void Add(Pawn pawn, int xCoordinate, int yCoordinate, PieceColor pieceColor) { throw new NotImplementedException("Need to implement ChessBoard.Add()"); }
public void SetUp() { _chessBoard = new ChessBoard(); _pawn = new Pawn(PieceColor.Black); }