TetrisGame implements Joystick, Game { @Override public void left() { moveHorizontallyIfAccepted(x - 1 < currentFigure.getLeft() ? currentFigure.getLeft() : x - 1); } TetrisGame(FigureQueue queue, final Glass glass, PrinterFactory factory); void tick(); void down(); @Override void up(); @Override void left(); @Override void right(); @Override void act(int... p); void act(int times); Figure.Type getCurrentFigureType(); int getCurrentFigureX(); int getCurrentFigureY(); List<Figure.Type> getFutureFigures(); @Override Joystick getJoystick(); @Override int getMaxScore(); @Override int getCurrentScore(); @Override boolean isGameOver(); @Override void newGame(); @Override String getBoardAsString(); @Override void destroy(); @Override void clearScore(); @Override Point getHero(); @Override String getSave(); static final int GLASS_HEIGHT; static final int GLASS_WIDTH; }
@Test @GivenFiguresInQueue({@FigureProperties}) public void shouldChangePositionWhenOnlyNextStep(){ game.left(); assertCoordinates(CENTER_X, TOP_Y); }