Ejemplo n.º 1
0
        public void GetNextState__BlueCell_Neighbours0Red3Green0Blue__CellBecomesGreen()
        {
            var          cell           = CellTestHelper.MakeBlueCyclicRGBCell();
            List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(0, 3, 0);

            CellTestHelper.EvolveCell(cell, deadNeighbours);
            Assert.IsTrue(cell.CurrentState == State.GREEN);
        }
Ejemplo n.º 2
0
        public void GetNextState__BlueCell_Neighbours3Red2Green0Blue__CellStaysBlue()
        {
            var          cell           = CellTestHelper.MakeBlueCyclicRGBCell();
            List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(3, 2, 0);

            CellTestHelper.EvolveCell(cell, deadNeighbours);
            Assert.IsTrue(cell.CurrentState == State.BLUE);
        }
Ejemplo n.º 3
0
        public void GetNextState_0LiveNeighbours_CellStateDoesNotChange()
        {
            var deadCell  = CellTestHelper.MakeDeadCyclicRGBCell();
            var redCell   = CellTestHelper.MakeRedCyclicRGBCell();
            var greenCell = CellTestHelper.MakeGreenCyclicRGBCell();
            var blueCell  = CellTestHelper.MakeBlueCyclicRGBCell();

            List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(0, 0, 0);

            CellTestHelper.EvolveCell(deadCell, deadNeighbours);
            CellTestHelper.EvolveCell(redCell, deadNeighbours);
            CellTestHelper.EvolveCell(greenCell, deadNeighbours);
            CellTestHelper.EvolveCell(blueCell, deadNeighbours);

            Assert.IsTrue(deadCell.CurrentState == State.DEAD);
            Assert.IsTrue(redCell.CurrentState == State.RED);
            Assert.IsTrue(greenCell.CurrentState == State.GREEN);
            Assert.IsTrue(blueCell.CurrentState == State.BLUE);
        }