public void WhenGivenDeadCellWithTooFewNeighbours_UpdateCell_CellRemainsDead() { Cell cell = new Cell(CellState.dead); Cell[] neighbours = GenerateNeighbours(2, 3); Domain.ICellService cellService = new Domain.CellService(); CellState newState = cellService.GetNewCellState(cell, neighbours); Assert.True(newState == CellState.dead); }
public void WhenGivenDeadCellWithEnoughNeighbours_UpdateCell_CellBecomesAlive() { Cell cell = new Cell(CellState.dead); Cell[] neighbours = GenerateNeighbours(3, 3); Domain.ICellService cellService = new Domain.CellService(); CellState newState = cellService.GetNewCellState(cell, neighbours); Assert.True(newState == CellState.alive); }
public void WhenGivenLiveCellWithTooManyNeighbours_UpdateCell_CellIsKilled() { Cell cell = new Cell(CellState.alive); Cell[] neighbours = GenerateNeighbours(4, 3); Domain.ICellService cellService = new Domain.CellService(); CellState newState = cellService.GetNewCellState(cell, neighbours); Assert.True(newState == CellState.dead); }