public void Indent() { Assert.AreEqual("", CsUtility.Indent("", 0)); Assert.AreEqual(" a", CsUtility.Indent("a", 1)); Assert.AreEqual(" a", CsUtility.Indent("a", 2)); Assert.AreEqual(" a\r\n b", CsUtility.Indent("a\r\nb", 2)); Assert.AreEqual(" a\r\n b", CsUtility.Indent("a\nb", 2)); }
private string ReportWithFilePositionAndDetails(string message) { var report = new StringBuilder(); report.Append(message); if (!string.IsNullOrEmpty(FilePosition?.Path)) { report.AppendLine().Append(FilePosition.CanonicalOrigin); } if (!string.IsNullOrEmpty(Details)) { report.AppendLine().AppendLine("Details:").Append(CsUtility.Indent(Details, 3)); } return(report.ToString()); }