public void TestInputCommandNameKingIsEligible_DL() { List<Figure> figures = new List<Figure>(); figures.Add(new Pawn(new Position(0, 0), 'A')); figures.Add(new Pawn(new Position(0, 2), 'B')); figures.Add(new Pawn(new Position(0, 4), 'C')); figures.Add(new Pawn(new Position(0, 6), 'D')); figures.Add(new King(new Position(3, 7))); GameBoard gameBoard = new GameBoard(figures); Engine currentEngine = new Engine(gameBoard, figures); string command = "KUR"; Assert.IsTrue(currentEngine.ValidateCommand(command), "KDL is valid command"); }
public void TestInputCommandForPawnIsNotEligible() { List<Figure> figures = new List<Figure>(); figures.Add(new Pawn(new Position(0, 0), 'A')); figures.Add(new Pawn(new Position(0, 2), 'B')); figures.Add(new Pawn(new Position(0, 4), 'C')); figures.Add(new Pawn(new Position(0, 6), 'D')); figures.Add(new King(new Position(3, 7))); GameBoard gameBoard = new GameBoard(figures); Engine currentEngine = new Engine(gameBoard, figures); currentEngine.MoveCounter = 3; string currentComand = "ADRt"; Assert.IsFalse(currentEngine.ValidateCommand(currentComand), "Command is not valid named"); }
public void TestPawnUpMoveInTableBorders() { List<Figure> figures = new List<Figure>(); figures.Add(new Pawn(new Position(0, 0), 'A')); figures.Add(new Pawn(new Position(0, 2), 'B')); figures.Add(new Pawn(new Position(0, 4), 'C')); Pawn newPawn = new Pawn(new Position(3, 4), 'D'); figures.Add(newPawn); King newKing = new King(new Position(4, 5)); figures.Add(newKing); GameBoard gameBoard = new GameBoard(figures); Engine currentEngine = new Engine(gameBoard, figures); Position newPosition = currentEngine.GetNewCoordinates(newPawn, Direction.UR) ; Assert.IsFalse(currentEngine.ValidateCommand("DUR"), "You can't move in this direction"); }