Exemplo n.º 1
0
        public void GetNextState__RedCell_Neighbours0Red0Green2Blue__CellStaysRed()
        {
            var          cell           = CellTestHelper.MakeRedCyclicRGBCell();
            List <State> deadNeighbours = CellTestHelper.CreateRGBNeighboursList(0, 0, 2);

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