コード例 #1
0
 public void When_a_living_cell_with_2_living_and_1_dead_neighbor_evolves_the_result_is_alive()
 {
     B3S23CellEvolver cellEvolver = new B3S23CellEvolver();
     Cell evolved = cellEvolver.Evolve(Cell.Alive, GetNeighbors(2, 1));
     Assert.IsTrue(evolved.IsAlive());
 }
コード例 #2
0
 public void When_a_living_cell_with_5_living_neighbors_evolves_the_result_is_dead()
 {
     B3S23CellEvolver cellEvolver = new B3S23CellEvolver();
     Cell evolved = cellEvolver.Evolve(Cell.Alive, GetNeighbors(5));
     Assert.IsFalse(evolved.IsAlive());
 }
コード例 #3
0
 public void When_a_dead_cell_with_3_living_neighbors_evolves_the_result_is_alive()
 {
     B3S23CellEvolver cellEvolver = new B3S23CellEvolver();
     Cell evolved = cellEvolver.Evolve(Cell.Dead, GetNeighbors(3));
     Assert.IsTrue(evolved.IsAlive());
 }