Beispiel #1
0
  @Test
  public void shouldRemainAliveWhenReviveIsCalledOnAliveCell() {
    Cell cell = new Cell(true);

    cell.revive();

    assertEquals(new Cell(true).format(), cell.format());
  }
Beispiel #2
0
  @Test
  public void shouldReviveDeadCellWhenReviveIsCalled() {
    Cell cell = new Cell(false);

    cell.revive();

    assertEquals(new Cell(true).format(), cell.format());
  }
Beispiel #3
0
  @Test
  public void shouldRemainDeadWhenKillIsCalledOnDeadCell() {
    Cell cell = new Cell(false);

    cell.kill();

    assertEquals(new Cell(false).format(), cell.format());
  }
Beispiel #4
0
  @Test
  public void shouldKillAliveCellWhenKillIsCalled() {
    Cell cell = new Cell(true);

    cell.kill();

    assertEquals(new Cell(false).format(), cell.format());
  }
Beispiel #5
0
  @Test
  public void shouldReturnXIfCellIsAliveWhenFormatIsCalled() {
    Cell cell = new Cell(true);

    assertEquals("X", cell.format());
  }
Beispiel #6
0
  @Test
  public void shouldReturnHiphenIfCellIsDeadWhenFormatIsCalled() {
    Cell cell = new Cell(false);

    assertEquals("-", cell.format());
  }