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); }
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); }
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); }
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); }