Example #1
0
        public void ConvertTabsToSpaces_should_replace_tabs_with_given_amount_of_spaces()
        {
            // Arrange
            string text = "Lorem ipsum dolor sit amet,\t consectetur adipiscing elit.\t\t Proin in quam enim. Integer consequat efficitur maximus.\t\t\tIn egestas eget magna viverra varius.";

            // Act
            string output = TextUtils.ConvertTabsToSpaces(text, 8);

            // Assert
            string t = new(' ', 8);

            output.Should().Be($"Lorem ipsum dolor sit amet,{t} consectetur adipiscing elit.{t}{t} Proin in quam enim. Integer consequat efficitur maximus.{t}{t}{t}In egestas eget magna viverra varius.");

            _output.WriteLine(text);
        }
Example #2
0
        private void WriteCommandManual(CommandSchema command)
        {
            if (string.IsNullOrWhiteSpace(command.Manual))
            {
                return;
            }

            if (!IsEmpty)
            {
                WriteVerticalMargin();
            }

            WriteHeader("Manual");
            WriteHorizontalMargin();

            string text = TextUtils.ConvertTabsToSpaces(command.Manual);

            text = TextUtils.AdjustNewLines(text);

            Write(text);

            WriteLine();
        }