Exemple #1
0
        public void DeadCell_WithThreeNeighbours_Live(int liveNeighbours)
        {
            CellState currentState = CellState.Dead;

            CellState nextState = LifeRules.GetNextState(currentState, liveNeighbours);

            Assert.AreEqual(CellState.Alive, nextState);
        }
Exemple #2
0
        public void LiveCell_LessThan2Neighbours_Die(int liveNeighbours)
        {
            CellState currentState = CellState.Alive;

            CellState nextState = LifeRules.GetNextState(currentState, liveNeighbours);

            Assert.AreEqual(CellState.Dead, nextState);
        }
Exemple #3
0
        public void DeadCell_WithMoreThenThreeNeighbours_Die
            ([Range(4, 8)] int liveNeighbours)
        {
            CellState currentState = CellState.Dead;

            CellState nextState = LifeRules.GetNextState(currentState, liveNeighbours);

            Assert.AreEqual(CellState.Dead, nextState);
        }