Exemple #1
0
        public void AnAliveCellWithTwoOrThreeNeighbors_ShouldResultInALiveCell()
        {
            int numberOfNeighbors = 2;

            Assert.That(GameOfLifeRules.ApplyRules(numberOfNeighbors, State.Alive), Is.EqualTo(State.Alive));

            numberOfNeighbors = 3;

            Assert.That(GameOfLifeRules.ApplyRules(numberOfNeighbors, State.Alive), Is.EqualTo(State.Alive));
        }
Exemple #2
0
        public void AnDeadCellWithExactlyThreeNeighbors_ShouldResultInAnAliveCell()
        {
            int numberOfNeighbors = 3;

            Assert.That(GameOfLifeRules.ApplyRules(numberOfNeighbors, State.Dead), Is.EqualTo(State.Alive));
        }
Exemple #3
0
        public void ADeadCellWithNoNeighbors_ShouldResultInADeadCell()
        {
            int numberOfNeighbors = 0;

            Assert.That(GameOfLifeRules.ApplyRules(numberOfNeighbors, State.Dead), Is.EqualTo(State.Dead));
        }