Пример #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());
  }