public void Whether_Knight_CantMoveToIncorrectSquare_On_CanMoveTo() { var board = new Board(); var knight = new Knight(new Square(4, 4), board, PieceColor.White); Assert.That(knight.CanMoveTo(new Square(5, 5)), Is.False); }
public void Whether_Knight_CantMoveToOccupiedSquare_On_CanMoveTo() { var board = new Board(); var knight = new Knight(new Square(4, 4), board, PieceColor.White); var anotherKnight = new Knight(new Square(5, 6), board, PieceColor.White); Assert.That(knight.CanMoveTo(new Square(5, 6)), Is.False); }
public void Whether_Knight_CantMoveOutsideTheBoard_On_CanMoveTo() { var board = new Board(); var knight = new Knight(new Square(1, 1), board, PieceColor.White); Assert.That(knight.PossibleMoves().Count() == 2); Assert.That(knight.CanMoveTo(new Square(-1, 2)), Is.False); }
public void Whehter_Knight_CanMoveToPossibleSquare_On_CanMoveTo(int offsetX, int offsetY) { var board = new Board(); var knight = new Knight(new Square(5, 4), board, PieceColor.White); Assert.That(knight.CanMoveTo( new Square(knight.Position.XPosition + offsetX, knight.Position.YPosition + offsetY))); }