internal static void ScenarioFailedIfAny(this IEnumerable <LambdaExpression> failed) { failed = failed.ToList(); if (failed.Any()) { throw new ScenarioException("The following assertions failed:" + Environment.NewLine + failed.Aggregate( new StringBuilder(), (builder, assertion) => builder.Append('\t').Append(PAssertFormatter.CreateSimpleFormatFor(assertion)).AppendLine())); } }
private static IEnumerable <string> NicePrintExpression(LambdaExpression target, string prefix) { yield return(prefix + PAssertFormatter.CreateSimpleFormatFor(target)); }