Пример #1
0
        public void ShouldCellDieWhenIsLonely()
        {
            Game game = new Game(2, 2);

            game.GameBoard.GiveLife(1, 1);
            game.ProcessNextGeneration();
            Thread.Sleep(10);

            Assert.IsFalse(game.GameBoard.IsCellExist(1, 1));
        }
Пример #2
0
        public void ShouldLivingCellDieWhenHasLessThanTwoNeighbours()
        {
            Game game = new Game(5, 5);

            game.GameBoard.GiveLife(2, 2);
            game.GameBoard.GiveLife(3, 2);
            game.ProcessNextGeneration();
            Thread.Sleep(10);

            //cell should die, if less than 2 Neighbour
            Assert.IsFalse(game.GameBoard.IsCellExist(2, 2));
        }
Пример #3
0
        public void ShouldLiveCellStillLiveWhenThreeNeighbours()
        {
            // test for two neighbours
            Game game = new Game(5,5);
            Board b = game.GameBoard;

            b.GiveLife(2, 2);
            b.GiveLife(3, 2);
            b.GiveLife(2, 3);
            b.GiveLife(3, 3);
            game.ProcessNextGeneration();

            Assert.IsTrue(b.IsCellExist(2, 2));
        }
Пример #4
0
        public void ShouldLivingCellDieWhenHasMoreThanThreeNeighbours()
        {
            Game game = new Game(5, 5);
            Board b = game.GameBoard;

            b.GiveLife(2, 2);
            b.GiveLife(3, 2);
            b.GiveLife(2, 3);
            b.GiveLife(3, 3);
            b.GiveLife(1, 3);
            game.ProcessNextGeneration();
            Thread.Sleep(10);

            Assert.IsFalse(game.GameBoard.IsCellExist(2, 2));
        }