public void GetNextState__DeadCell_Neighbours2Red2Green3Blue__CellBecomesBlue() { var cell = CellTestHelper.MakeDeadCyclicRGBCell(); List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(2, 2, 3); CellTestHelper.EvolveCell(cell, deadNeighbours); Assert.IsTrue(cell.CurrentState == State.BLUE); }
public void GetNextState__DeadCell_Neighbours3Red3Green3Blue__CellBecomesRedOrGreenOrBlue() { var cell = CellTestHelper.MakeDeadCyclicRGBCell(); List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(3, 3, 3); CellTestHelper.EvolveCell(cell, deadNeighbours); Assert.IsTrue(cell.CurrentState == State.RED || cell.CurrentState == State.GREEN || cell.CurrentState == State.BLUE); }
public void GetNextState_0LiveNeighbours_CellStateDoesNotChange() { var deadCell = CellTestHelper.MakeDeadCyclicRGBCell(); var redCell = CellTestHelper.MakeRedCyclicRGBCell(); var greenCell = CellTestHelper.MakeGreenCyclicRGBCell(); var blueCell = CellTestHelper.MakeBlueCyclicRGBCell(); List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(0, 0, 0); CellTestHelper.EvolveCell(deadCell, deadNeighbours); CellTestHelper.EvolveCell(redCell, deadNeighbours); CellTestHelper.EvolveCell(greenCell, deadNeighbours); CellTestHelper.EvolveCell(blueCell, deadNeighbours); Assert.IsTrue(deadCell.CurrentState == State.DEAD); Assert.IsTrue(redCell.CurrentState == State.RED); Assert.IsTrue(greenCell.CurrentState == State.GREEN); Assert.IsTrue(blueCell.CurrentState == State.BLUE); }