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); }
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(); }