Пример #1
0
 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);
 }
Пример #2
0
 public void TestEmpty()
 {
     GoL.Grid grid = new GoL.Grid(10, 10);
     Assert.AreEqual(grid.CountCells(), 0);
 }
Пример #3
0
 public void Neighbours3()
 {
     GoL.Grid grid = new GoL.Grid(10, 10);
     grid.SetCell(-1, -1, true);
     Assert.AreEqual(grid.CountNeighbours(0, 1), 1);
 }
Пример #4
0
 public void Neighbours1()
 {
     GoL.Grid grid = new GoL.Grid(10, 10);
     grid.SetCell(5, 5, true);
     Assert.AreEqual(grid.CountNeighbours(5, 4), 1);
 }