public void PointShouldDie_Given1And1WithFewerThanTwoNeighbours_ShouldReturn0() { //---------------Set up test pack------------------- _game = new Game(10); _game.Toggle(0, 0); _game.Toggle(1, 1); //---------------Assert Precondition---------------- Assert.AreEqual(1, _game.ValueOfPoint(1, 1)); //---------------Execute Test ---------------------- _game.Proc(); //---------------Test Result ----------------------- Assert.AreEqual(0, _game.ValueOfPoint(1, 1)); }
public void PointHasExactlyThreeNeighboursAndIsDead_Given1And1_ShouldReturnTrue() { //---------------Set up test pack------------------- _game = new Game(10); _game.Toggle(0, 0); _game.Toggle(1, 0); _game.Toggle(2, 0); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var hasThreeNeighboursAndIsDead = _game.PointHasThreeNeighboursAndIsDead(1, 1); //---------------Test Result ----------------------- Assert.IsTrue(hasThreeNeighboursAndIsDead); }
public void PointHasMoreThan3Neighbours_GivenPointsAround1And1_ShouldReturnFalse() { //---------------Set up test pack------------------- _game = new Game(10); _game.Toggle(0, 0); _game.Toggle(1, 0); _game.Toggle(2, 0); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var hasMoreThanThreeNeighbours = _game.PointHasMoreThanThreeNeighbours(1, 1); //---------------Test Result ----------------------- Assert.IsFalse(hasMoreThanThreeNeighbours); }
public void PointHasFewerThanTwoNeghbours_Given1And1_ShouldReturnTrue() { //---------------Set up test pack------------------- _game = new Game(10); _game.Toggle(1, 1); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var hasFewerThanTwoNeighbours = _game.PointHasFewerThanTwoNeighbours(1, 1); //---------------Test Result ----------------------- Assert.IsTrue(hasFewerThanTwoNeighbours); }
public void Toggle_GivenCoordinate0And0_ShouldReturnPosition0And0As1() { //---------------Set up test pack------------------- _game.SetBoard(10); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- _game.Toggle(0, 0); int mapValue = _game.ValueOfPoint(0, 0); //---------------Test Result ----------------------- Assert.AreEqual(1, mapValue); }