public void InfiniteBoardDeadRule() { InfiniteBoard world = new InfiniteBoard(); world.AddCell(1, 0); world.AddCell(0, 1); world.AddCell(1, 1); world.DeadRule(0, 0); Assert.AreEqual(true, world.CellDoesExist(0, 0)); }
public void InfiniteBoardGetNumberOfAliveNeighhbors() { InfiniteBoard world = new InfiniteBoard(); world.AddCell(0, 0); world.AddCell(1, 0); world.AddCell(0, 1); world.AddCell(1, 1); int alive = world.getNumberOfAliveNeighbors(world.Cells[0].X, world.Cells[0].Y); Assert.AreEqual(3, alive); }
public void InfiniteBoardEnsureThereAreCells() { InfiniteBoard world = new InfiniteBoard(); int x = 4; int y = 3; world.AddCell(x, y); Assert.AreEqual(1, world.CellCount()); }
public void InfiniteBoardTestDoAll() { InfiniteBoard world = new InfiniteBoard(); world.AddCell(0, 0); world.AddCell(0, 1); world.AddCell(0, -1); world.DoAll(); Assert.AreEqual(false, world.CellDoesExist(0, 1)); Assert.AreEqual(false, world.CellDoesExist(0, -1)); Assert.AreEqual(true, world.CellDoesExist(1, 0)); Assert.AreEqual(true, world.CellDoesExist(-1, 0)); }
public void InfiniteBoardCellDoesExist() { InfiniteBoard world = new InfiniteBoard(); world.AddCell(0, 0); Assert.IsTrue(world.CellDoesExist(0, 0)); }
public void InfiniteBoardTestRemoveCell() { InfiniteBoard world = new InfiniteBoard(); world.AddCell(0, 0); world.RemoveCell(0, 0); Assert.IsFalse(world.CellDoesExist(0, 0)); Assert.AreEqual(0, world.CellCount()); }
public void InfiniteBoardTestDoOneCellWithDeadCell() { InfiniteBoard world = new InfiniteBoard(); world.AddCell(1, 0); world.AddCell(0, 1); world.AddCell(1, 1); world.DoOneCell(0, 0); Assert.AreEqual(true, world.CellDoesExist(0, 0)); }