Created
December 5, 2011 18:14
-
-
Save JeffHoover/1434631 to your computer and use it in GitHub Desktop.
From my data-driven Game of Life code from Global Day of CodeRetreat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Full code base: | |
// https://github.com/JeffHoover/Data-Driven-GoL | |
// Hard to read bare assertion: | |
// Assert.AreEqual(State.DEAD, _ruleEngine.GetNextCellState(State.DEAD, numNeighbors)); | |
// Easier to read helper method: | |
Assert_Dead_Cell_Stays_Dead_With_X_Neighbors(numNeighbors)); | |
// Suggested by @mattslavicek - loses important information about cell starting state | |
// AssertCellEvolvesAndRemainsDead(int numNeighbors)); | |
// Another hard-to-read bare assertion: | |
// Assert.AreEqual(State.DEAD, _ruleEngine.GetNextCellState(State.DEAD, numNeighbors)); | |
// Maybe: | |
// AssertDeadCellEvolvesAndStaysDead(int numNeighbors)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment