コード例 #1
0
        public void AdjustNewLines_should_adjust_new_lines_to_current_system()
        {
            // Arrange
            string text = "Lorem ipsum dolor sit amet,\r consectetur adipiscing elit.\n Proin in quam enim.\r\n Integer consequat efficitur maximus.\r\n\r In egestas eget magna viverra varius.\n\r";

            // Act
            string output = TextUtils.AdjustNewLines(text);

            // Assert
            string le = Environment.NewLine;

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

            _output.WriteLine(text);
        }
コード例 #2
0
ファイル: DefaultHelpWriter.cs プロジェクト: adambajguz/Typin
        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();
        }