Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
 public void TestPawn_SymbolRepresentationValidLetter_z()
 {
     Pawn pawn = new Pawn(new Position(3, 0), 'z');
     char actualSymbol = pawn.SymbolRepresentation;
     Assert.AreEqual('z', actualSymbol, "Pawn symbol representation is not working correctly");
 }
Ejemplo n.º 3
0
        public void TestPawnImpossibleMove()
        {
            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.DR) ;

            Assert.IsNull(newPosition, "You can't move here,cell is busy");
        }
Ejemplo n.º 4
0
 public void TestPawn_SymbolRepresentationInvalidSymbol_Space()
 {
     //TODO: to finish that method
     Pawn pawn = new Pawn(new Position(3, 0), ' ');
 }