示例#1
0
        public void ShouldReturnDeadIfAliveAnd4OrMoreAliveNeighbours()
        {
            var gameOfLifeRule            = new GameOfLifeRules();
            var deadOrAliveNeighbourCount = new DeadOrAliveNeighboursCount {
                AliveNeighbourCount = 4
            };
            var result = gameOfLifeRule.LifeStatusForNextTick(deadOrAliveNeighbourCount, LifeStatus.Alive);

            Assert.AreEqual(LifeStatus.Dead, result);
        }
示例#2
0
        public void ShouldNotReturnAliveIfAliveAnd2AliveNeighbours()
        {
            var gameOfLifeRule            = new GameOfLifeRules();
            var deadOrAliveNeighbourCount = new DeadOrAliveNeighboursCount {
                AliveNeighbourCount = 2
            };
            var result = gameOfLifeRule.LifeStatusForNextTick(deadOrAliveNeighbourCount, LifeStatus.Alive);

            Assert.AreEqual(LifeStatus.Alive, result);
        }