private static string GetTestResultMessageText()

in BoostTestAdapter/Utility/VisualStudio/VSTestModel.cs [210:256]


        private static string GetTestResultMessageText(TestUnit unit, LogEntry entry)
        {
            Code.Require(unit, "unit");
            Code.Require(entry, "entry");

            if ((entry is LogEntryStandardOutputMessage) || (entry is LogEntryStandardErrorMessage))
            {
                return entry.Detail.TrimEnd(null) + Environment.NewLine;
            }

            StringBuilder sb = new StringBuilder();

            if (entry.Source != null)
            {
                AppendSourceInfo(entry.Source, sb);
            }

            sb.Append(entry.ToString().ToLowerInvariant()).
                Append(" in \"").
                Append(unit.Name).
                Append("\"");

            LogEntryMemoryLeak memoryLeak = entry as LogEntryMemoryLeak;
            if (memoryLeak == null)
            {
                sb.Append(": ").Append(entry.Detail.TrimEnd(null));
            }

            LogEntryException exception = entry as LogEntryException;
            if (exception != null)
            {
                FormatException(exception, sb);
            }

            if ((entry.ContextFrames != null) && (entry.ContextFrames.Any()))
            {
                FormatContextFrames(entry, sb);
            }

            if (memoryLeak != null)
            {
                FormatMemoryLeak(memoryLeak, sb);
            }

            // Append NewLine so that log entries are listed one per line
            return sb.Append(Environment.NewLine).ToString();
        }