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

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

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

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

            Assert.AreEqual(CellState.Dead, nextState);
        }
예제 #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);
        }