コード例 #1
0
        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()));
            }
        }
コード例 #2
0
 private static IEnumerable <string> NicePrintExpression(LambdaExpression target, string prefix)
 {
     yield return(prefix + PAssertFormatter.CreateSimpleFormatFor(target));
 }