Ejemplo n.º 1
0
 public void CalculateCell_IsDead_ThreeAlive_ComesAlive() =>
 CellCalculatorBase.CalculateCell(new StandardCellCalculator(), Dead(), Enumerable.Repeat(Alive(), 3), new StandardWorldData(),
                                  cell => cell.IsAlive,
                                  cell => cell.LifeTime == 1);
Ejemplo n.º 2
0
 public void CalculateCell_IsAlive_TwoAlive_StaysAlive() =>
 CellCalculatorBase.CalculateCell(new StandardCellCalculator(), Alive(), Enumerable.Repeat(Alive(), 2), new StandardWorldData(),
                                  cell => cell.IsAlive,
                                  cell => cell.LifeTime == 2);
Ejemplo n.º 3
0
 public void CalculateCell_IsAlive_FiveAlive_Dies() =>
 CellCalculatorBase.CalculateCell(new StandardCellCalculator(), Alive(), Enumerable.Repeat(Alive(), 5), new StandardWorldData(),
                                  cell => !cell.IsAlive,
                                  cell => cell.LifeTime == 0);
Ejemplo n.º 4
0
 public void CalculateCell_IsAlive_NoneAlive_Dies() =>
 CellCalculatorBase.CalculateCell(new StandardCellCalculator(), Alive(), Enumerable.Empty <StandardCell>(), new StandardWorldData(),
                                  cell => !cell.IsAlive,
                                  cell => cell.LifeTime == 0);