Пример #1
0
        public GameOfLife(string input)
        {
            var parser = new Parser();

            var parsedInput = parser.Parse(input);

            table = new Table(parsedInput);

            printer = new TablePrinter();
        }
        public void CheckThePrintString()
        {
            var inputTable = new bool[,] {
            {false, true},
            {true, true}
            };

            var printer = new TablePrinter();

            var output = printer.Print(inputTable);

            Assert.AreEqual(".*\n**", output);
        }
        public void CheckTheTypicalBoolTable()
        {
            var inputTable = new bool[,]
            {
            {false, true, false},
            {true, true, false},
            {false, true, false}
            };

            var printer = new TablePrinter();

            var output = printer.Print(inputTable);
            var expectedOutput = ".*.\n" +
                                 "**.\n" +
                                 ".*.";

            Assert.AreEqual(expectedOutput, output);
        }