Пример #1
0
        public void WhenOneDeadCell_ReturnsSameState()
        {
            const string input = "1,1\n.";
            var          game  = new GameOfLife();

            var nextGeneration = game.Next(input);

            Assert.AreEqual(input, nextGeneration);
        }
Пример #2
0
        public void WhenFieldWithDeadAndAliveCell_ReturnsTwoDeadCells()
        {
            const string inputWithDeadAndAlive    = "1,2\n.*";
            const string expectedWithTwoDeadCells = "1,2\n..";
            var          game = new GameOfLife();

            var nextGeneration = game.Next(inputWithDeadAndAlive);

            Assert.AreEqual(expectedWithTwoDeadCells, nextGeneration);
        }
Пример #3
0
        public void WhenOneAliveCell_ReturnsDeadCell()
        {
            const string input = "1,1\n*";
            const string expectedWithDeadCell = "1,1\n.";
            var          game = new GameOfLife();

            var nextGeneration = game.Next(input);

            Assert.AreEqual(expectedWithDeadCell, nextGeneration);
        }