@Test public void aCellAliveTest() { // GIVEN Cell cell = new Cell(); // WHEN boolean status = cell.isAlive(); // THEN assertFalse("A new cell is dead", status); }
public void aDeadCellWith2NeighboursStaysDeadTest() { // GIVEN int numberOfNeighbours = 2; Cell cell = new Cell(false, numberOfNeighbours); // WHEN cell.nextStep(); boolean status = cell.isAlive(); // THEN assertFalse("A cell with 2 neighbours stays dead", status); }
@Test public void aCellLivesWith3NeighboursTest() { // GIVEN int numberOfNeighbours = 3; Cell cell = new Cell(true, numberOfNeighbours); // WHEN cell.nextStep(); boolean status = cell.isAlive(); // THEN assertTrue("A cell with 3 neighbours lives or is reanimated", status); }
@Test public void shouldReturnFalseIfCellIsDeadWhenIsAliveIsCalled() { Cell cell = new Cell(false); assertFalse(cell.isAlive()); }
@Test public void shouldReturnTrueIfCellIsAliveWhenIsAliveIsCalled() { Cell cell = new Cell(true); assertTrue(cell.isAlive()); }