public static string GetBriefSummary(this IOutputResult result) { var operationsCount = result.GetOperationResults().Count(x => !(x is FillingOperationResult)); var exceptions = result.GetExceptions().ToList(); return(exceptions.Count == 0 ? $"{operationsCount} {(operationsCount > 1 ? "operations" : "operation")} run" : exceptions.Count == 1 ? exceptions.Single().Name : $"exceptions.Count {(exceptions.Count > 1 ? "exceptions" : "exception")} thrown"); }
public static string GetDetailedSummary(this IOutputResult result, ISymbolProvider symbolProvider = null, bool includeExceptions = true) { symbolProvider = symbolProvider ?? new DefaultSymbolProvider(); var builder = new StringBuilder(); AppendOperations(result.GetOperationResults(), builder, symbolProvider); AppendOutput(result.OutputEntries, builder, symbolProvider); if (includeExceptions) { AppendExceptions(result.GetExceptions(), builder); } return(builder.ToString()); }
public static IEnumerable <IExceptionDescriptor> GetExceptions(this IOutputResult result) { return(result.GetOperationResults().Select(x => x.Exception).WhereNotNull()); }