コード例 #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);
コード例 #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);
コード例 #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);
コード例 #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);