Exemple #1
0
        public void GetNextState__GreenCell_Neighbours2Red0Green3Blue__CellStaysGreen()
        {
            var          cell           = CellTestHelper.MakeGreenCyclicRGBCell();
            List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(2, 0, 3);

            CellTestHelper.EvolveCell(cell, deadNeighbours);
            Assert.IsTrue(cell.CurrentState == State.GREEN);
        }
Exemple #2
0
        public void GetNextState__GreenCell_Neighbours3Red0Green0Blue__CellBecomesRed()
        {
            var          cell           = CellTestHelper.MakeGreenCyclicRGBCell();
            List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(3, 0, 0);

            CellTestHelper.EvolveCell(cell, deadNeighbours);
            Assert.IsTrue(cell.CurrentState == State.RED);
        }
Exemple #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);
        }