Esempio n. 1
0
        public void Dead_Cell_With_More_Than_Three_Neighbors_Stays_Dead(
            [Values(CellState.Dead)] CellState currentState, [Range(4, 8)] int liveNeighbors)
        {
            CellState newState = GameOfLifeRules.GetNewState(currentState, liveNeighbors);

            Assert.AreEqual(CellState.Dead, newState);
        }
Esempio n. 2
0
        public void Live_Cell_With_Two_Or_Three_Live_Neighbors_Lives(
            [Values(CellState.Alive)] CellState currentState, [Values(2, 3)] int liveNeighbors)
        {
            CellState newState = GameOfLifeRules.GetNewState(currentState, liveNeighbors);

            Assert.AreEqual(CellState.Alive, newState);
        }
Esempio n. 3
0
        public void Dead_Cell_With_Exactly_Three_Neighbors_Becomes_A_Live_Cell(
            [Values(CellState.Dead)] CellState currentState, [Values(3)] int liveNeighbors)
        {
            CellState newState = GameOfLifeRules.GetNewState(currentState, liveNeighbors);

            Assert.AreEqual(CellState.Alive, newState);
        }
Esempio n. 4
0
        public void Live_Cell_With_Fewer_Than_Two_Live_Neighbors_Dies(
            [Values(CellState.Alive)] CellState currentState, [Values(0, 1)] int liveNeighbors)
        {
            CellState newState = GameOfLifeRules.GetNewState(currentState, liveNeighbors);

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