Beispiel #1
0
 public static ITargetBuilder SkipIf(this ITargetBuilder builder, Func <bool> predicate, string message = null)
 {
     return(builder.Wrap((target, next) =>
     {
         if (predicate())
         {
             target.MarkSkipped(message);
         }
         else
         {
             next(target);
         }
     }));
 }
Beispiel #2
0
 public static ITargetBuilder PreCondition(this ITargetBuilder builder, Func <bool> predicate, string message = null)
 {
     return(builder.Wrap((target, next) =>
     {
         if (!predicate())
         {
             target.MarkFailed(message, null);
         }
         else
         {
             next(target);
         }
     }));
 }