Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine(FiggleFonts.Bubble.Render(Messages.Welcome));

            var input = new Input();

            var grid = GridSetUp.SetUpGrid(input);

            Console.Clear();
            Output.DisplayString(grid.GetFormattedString());

            var game = new Game(grid, input);

            game.SetInitialLiveCells();
            game.UpdateGridAtEachTick();
        }
Пример #2
0
        public void SetUpGridWithCorrectDimensions()
        {
            var mockInput = new Mock <IInput>();

            mockInput.SetupSequence(i => i.ReadInput())
            .Returns("5")
            .Returns("5");

            var expected =
                "[ ][ ][ ][ ][ ]" + Environment.NewLine +
                "[ ][ ][ ][ ][ ]" + Environment.NewLine +
                "[ ][ ][ ][ ][ ]" + Environment.NewLine +
                "[ ][ ][ ][ ][ ]" + Environment.NewLine +
                "[ ][ ][ ][ ][ ]" + Environment.NewLine;

            var actual = GridSetUp.SetUpGrid(mockInput.Object);

            Assert.Equal(expected, actual.GetFormattedString());
        }
Пример #3
0
        public void ContinueToReceiveDimensionInputsUntilInputIsValid()
        {
            var mockInput = new Mock <IInput>();

            mockInput.SetupSequence(i => i.ReadInput())
            .Returns("a")
            .Returns("5")
            .Returns("b")
            .Returns("5");

            var expected =
                "[ ][ ][ ][ ][ ]" + Environment.NewLine +
                "[ ][ ][ ][ ][ ]" + Environment.NewLine +
                "[ ][ ][ ][ ][ ]" + Environment.NewLine +
                "[ ][ ][ ][ ][ ]" + Environment.NewLine +
                "[ ][ ][ ][ ][ ]" + Environment.NewLine;

            var actual = GridSetUp.SetUpGrid(mockInput.Object);

            Assert.Equal(expected, actual.GetFormattedString());
        }
Пример #4
0
 void SetUpScreen()
 {
     screenRect = GridSetUp.GetScreenRect();
 }