Example #1
0
 public void SeedIsStoredAndNeighboursCountedCorrectly()
 {
     var testSeed = GetSimpleSeed();
     var testGrid = new Grid(testSeed);
     // the cell at 2,2 should have two neighbours
     Assert.AreEqual(2, testGrid.CurrentLiveCells[new CoOrds(2, 2)].LiveNeighbourCount);
 }
Example #2
0
        public void GridAccurateAfterOneTick()
        {
            var testGrid = new Grid(GetSimpleSeed());
            testGrid.Tick();

            var newGridState = new Dictionary<CoOrds, Cell>();
            newGridState.Add(new CoOrds(1, 2), new Cell(1, true));
            newGridState.Add(new CoOrds(2, 2), new Cell(1, true));

            Assert.IsTrue(testGrid.Equals(newGridState));
        }