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

    cell.revive();

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

    cell.revive();

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

    cell.kill();

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

    cell.kill();

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

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

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