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

    cell.revive();

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

    cell.revive();

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

    cell.kill();

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

    cell.kill();

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

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

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