Esempio n. 1
0
  @Test
  public void isFull() {
    final Pie pie = new Pie(bus);

    assertThat(pie.isFull(), is(false));

    pie.tryPlacePiece(Pie.SLOT_TOP_LEFT, Piece.ORANGE);
    assertThat(pie.isFull(), is(false));

    for (@Pie.Slot int slot = Pie.SLOT_TOP_LEFT; slot < Pie.NUMBER_SLOTS; slot++) {
      pie.tryPlacePiece(slot, Piece.ORANGE);
    }

    assertThat(pie.isFull(), is(true));
  }
Esempio n. 2
0
  @Test
  public void reset() {
    final Pie pie = new Pie(bus);

    assertThat(pie.isFull(), is(false));

    for (@Pie.Slot int slot = Pie.SLOT_TOP_LEFT; slot < Pie.NUMBER_SLOTS; slot++) {
      pie.tryPlacePiece(slot, Piece.ORANGE);
    }

    assertThat(pie.isFull(), is(true));

    pie.reset();

    assertThat(pie.isFull(), is(false));

    assertThat(occurrencesOf(events, pie.thisChanged), is(equalTo(7)));
  }