Exemplo n.º 1
0
        public void GetNextState_DeadCell_9LiveNeighbours_BecomesAlive()
        {
            var          cell           = CellTestHelper.MakeDeadViralCell();
            List <State> nineNeighbours = CellTestHelper.CreateConwayNeighboursList(9);

            CellTestHelper.EvolveCell(cell, nineNeighbours);
            Assert.IsTrue(cell.CurrentState == State.ALIVE);
        }
Exemplo n.º 2
0
        public void GetNextState_LiveCell_8LiveNeighbours_StaysAlive()
        {
            var          cell            = CellTestHelper.MakeLiveViralCell();
            List <State> eightNeighbours = CellTestHelper.CreateConwayNeighboursList(8);

            CellTestHelper.EvolveCell(cell, eightNeighbours);
            Assert.IsTrue(cell.CurrentState == State.ALIVE);
        }
Exemplo n.º 3
0
        public void GetNextState_DeadCell_6LiveNeighbours_StaysDead()
        {
            var          cell          = CellTestHelper.MakeDeadViralCell();
            List <State> sixNeighbours = CellTestHelper.CreateConwayNeighboursList(6);

            CellTestHelper.EvolveCell(cell, sixNeighbours);
            Assert.IsTrue(cell.CurrentState == State.DEAD);
        }
Exemplo n.º 4
0
        public void GetNextState_LiveCell_1LiveNeighbours_Dies()
        {
            var cell = CellTestHelper.MakeLiveCell();

            List <State> oneNeighbour = CellTestHelper.CreateConwayNeighboursList(1);

            CellTestHelper.EvolveCell(cell, oneNeighbour);

            Assert.IsTrue(cell.CurrentState == State.DEAD);
        }
Exemplo n.º 5
0
        public void GetNextState_DeadCell_0LiveNeighbours_Dies()
        {
            var cell = CellTestHelper.MakeDeadCell();

            List <State> zeroNeighbours = CellTestHelper.CreateConwayNeighboursList(0);

            CellTestHelper.EvolveCell(cell, zeroNeighbours);

            Assert.IsTrue(cell.CurrentState == State.DEAD);
        }