public void CellWithOneNeighbourDiesAfterATick()
 {
     var world = new World();
     world.SetLiveCellAt(new Location(1, 1));
     world.SetLiveCellAt(new Location(1, 2));
     World nextWorld = world.Tick();
     Assert.IsInstanceOfType(typeof(DeadCell), nextWorld.GetCellAt(new Location(1, 2)));
 }
 public void DeadCellWithExactlyThreeLivingNeighboursBecomesALiveCellAfterATick()
 {
     var world = new World();
     world.SetLiveCellAt(new Location(1, 0));   //  -x-
     world.SetLiveCellAt(new Location(0, 1));   //  xo-
     world.SetLiveCellAt(new Location(1, 2));   //  -x-
     World nextWorld = world.Tick();
     Assert.IsInstanceOfType(typeof(AliveCell), nextWorld.GetCellAt(new Location(1, 1)));
 }
 public void CellWithTwoNeighboursShouldLiveOnAfterNextTick()
 {
     var world = new World();
     world.SetLiveCellAt(new Location(1, 1));
     world.SetLiveCellAt(new Location(1, 2));
     world.SetLiveCellAt(new Location(2, 1));
     World nextWorld = world.Tick();
     Assert.IsInstanceOfType(typeof(AliveCell), nextWorld.GetCellAt(new Location(1, 1)));
 }
 public void GetCellAtShouldOnlyReturnLivingCellsWhenSet()
 {
     var world = new World();
     world.SetLiveCellAt(new Location(99, 99));
     Assert.IsInstanceOfType(typeof(DeadCell), world.GetCellAt(new Location(1, 1)));
     Assert.IsInstanceOfType(typeof(AliveCell), world.GetCellAt(new Location(99, 99)));
 }
 public void OneAliveCellShouldDieAfterATick()
 {
     var world = new World();
     world.SetLiveCellAt(new Location(1,1));
     Assert.IsAssignableFrom(typeof(AliveCell), world.GetCellAt(new Location(1, 1)), "before tick");
     World nextWorld = world.Tick();
     Assert.IsInstanceOfType(typeof(DeadCell), nextWorld.GetCellAt(new Location(1, 1)), "after tick");
 }