public void Ctor_GivenDimensions_CorrectDisplay()
        {
            var board    = new GameOfLifeBoard(10, 10);
            var renderer = new GameBoardRenderer();
            var output   = renderer.Render(board);

            foreach (var line in output)
            {
                Console.WriteLine(line);
            }
        }
        public void Render_GivenNullGameBoard_ThrowsException()
        {
            var ex = Assert.Throws <ArgumentException>(
                () => _renderer.Render(null));

            Assert.That(ex.Message, Is.EqualTo("Gameboard cannot be rendered."));
        }
Пример #3
0
        static void Main(string[] args)
        {
            var board    = new GameOfLifeBoard(50, 50);
            var renderer = new GameBoardRenderer();

            for (int i = 0; i < 100; i++)
            {
                var output = renderer.Render(board);

                Console.Clear();

                foreach (var line in output)
                {
                    Console.WriteLine(line);
                }

                Thread.Sleep(500);
                board.Step();
            }
        }