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"); }