Exemplo n.º 1
0
        public void GetNextState_DeadCell_2LiveNeighbours_StaysDead()
        {
            var cell = CellTestHelper.MakeDeadCell();

            List <State> twoNeighbours = CellTestHelper.CreateConwayNeighboursList(2);

            CellTestHelper.EvolveCell(cell, twoNeighbours);
            Assert.IsTrue(cell.CurrentState == State.DEAD);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public void GetNextState_DeadCell_3LiveNeighbours_BecomesAlive()
        {
            var cell = CellTestHelper.MakeDeadCell();

            List <State> threeNeighbours = CellTestHelper.CreateConwayNeighboursList(3);

            CellTestHelper.EvolveCell(cell, threeNeighbours);

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