Пример #1
0
  @Given("testDataPhase3")
  public UrsuppeGUI startPhase4(UrsuppeGUI ursuppe) {
    ursuppe.fakeTimer();

    assertThat(
        this.phaseLogic.getActivePhase(),
        checkPhase.checkPhase(GamePhases.phase4)); // Important! Each phase test must check this!

    this.goSleep();

    return ursuppe;
  }
Пример #2
0
  @Test
  public UrsuppeGUI scriptedGame1() {

    this.createSleeper();

    UrsuppeGUI ursuppe = new UrsuppeGUI(true, true);
    // ursuppe.run();

    this.phaseLogic = ursuppe.getPhaseLogic();
    this.activePhase = this.phaseLogic.getActivePhase();
    this.changePhase = this.phaseLogic.getChangePhase();

    this.game = ursuppe.getGame();
    this.die = this.game.getDie();

    /////////////////
    // WINDDIRECTION//
    /////////////////

    Stack<GameDirection> stackWind = new Stack<GameDirection>();

    stackWind.add(GameDirection.East);
    stackWind.add(GameDirection.East);
    stackWind.add(GameDirection.Middle);
    stackWind.add(GameDirection.West);
    stackWind.add(GameDirection.South);
    stackWind.add(GameDirection.North);

    assertThat(stackWind.size(), checkInteger.checkInteger(6));

    this.game.setStackOfWindDirection(stackWind);
    assertThat(stackWind.size(), checkInteger.checkInteger(5));
    assertThat(this.game.getActualeDirection(), checkDirection.checkDirection(GameDirection.North));

    /////////
    // OZONE//
    /////////

    Stack<Integer> stackOzone = new Stack<Integer>();

    stackOzone.add(10);
    stackOzone.add(7);
    stackOzone.add(12);
    stackOzone.add(6);
    stackOzone.add(9);
    stackOzone.add(10);

    assertThat(stackOzone.size(), checkInteger.checkInteger(6));

    this.game.setStackOfOzone(stackOzone);
    assertThat(stackOzone.size(), checkInteger.checkInteger(5));
    assertThat(this.game.getOzoneValue(), checkInteger.checkInteger(10));

    this.playerBlue = this.game.getPlayer(GameColor.blue);
    this.playerRed = this.game.getPlayer(GameColor.red);
    this.playerYellow = this.game.getPlayer(GameColor.yellow);

    assertFalse(this.die.isInTestMode());

    this.die.testModeOn();

    assertTrue(this.die.isInTestMode());

    // TEST LADDERSQUARES:
    for (int i = 1; i <= this.game.getBoard().getLadder().size(); i++) {
      LadderSquare ladderSquare = this.game.getBoard().getLadderSquare(i);

      assertThat(ladderSquare.getNumber(), checkInteger.checkInteger(i));
    }

    return ursuppe;
  }