public void TestNElements() { GoL.Grid grid = new GoL.Grid(10, 10); grid.SetCell(5, 5, true); grid.SetCell(5, 5, true); grid.SetCell(2, 5, true); Assert.AreEqual(grid.CountCells(), 2); }
public void TestEmpty() { GoL.Grid grid = new GoL.Grid(10, 10); Assert.AreEqual(grid.CountCells(), 0); }
public void Neighbours3() { GoL.Grid grid = new GoL.Grid(10, 10); grid.SetCell(-1, -1, true); Assert.AreEqual(grid.CountNeighbours(0, 1), 1); }
public void Neighbours1() { GoL.Grid grid = new GoL.Grid(10, 10); grid.SetCell(5, 5, true); Assert.AreEqual(grid.CountNeighbours(5, 4), 1); }