コード例 #1
0
 /// <summary>
 /// Declares a rollback action, relating to this step or previous steps, which will be
 /// executed after all steps in the current scenario have been executed.
 /// </summary>
 /// <param name="stepBuilder">The step builder.</param>
 /// <param name="onRollback">The rollback callback.</param>
 /// <returns>
 /// An instance of <see cref="IStepBuilder"/>.
 /// </returns>
 public static IStepBuilder Rollback(this IStepBuilder stepBuilder, Action <IStepContext> onRollback) =>
 onRollback == null
         ? stepBuilder
         : stepBuilder?.Rollback(context =>
 {
     onRollback(context);
     return(Task.FromResult(0));
 });
コード例 #2
0
 /// <summary>
 /// Declares a rollback action, relating to this step or previous steps, which will be
 /// executed after all steps in the current scenario have been executed.
 /// </summary>
 /// <param name="stepBuilder">The step builder.</param>
 /// <param name="onRollback">The rollback callback.</param>
 /// <returns>
 /// An instance of <see cref="IStepBuilder"/>.
 /// </returns>
 public static IStepBuilder Rollback(this IStepBuilder stepBuilder, Func <Task> onRollback) =>
 onRollback == null
         ? stepBuilder
         : stepBuilder?.Rollback(context => onRollback());
コード例 #3
0
 public static IStepBuilder Teardown(this IStepBuilder stepBuilder, Func <Task> onTeardown) => stepBuilder.Rollback(onTeardown);
コード例 #4
0
 /// <summary>
 /// Declares a rollback action, relating to this step or previous steps, which will be
 /// executed after all steps in the current scenario have been executed.
 /// </summary>
 /// <param name="stepBuilder">The step builder.</param>
 /// <param name="onRollback">The rollback callback.</param>
 /// <returns>
 /// An instance of <see cref="IStepBuilder"/>.
 /// </returns>
 public static IStepBuilder Rollback(this IStepBuilder stepBuilder, Action onRollback) =>
 onRollback == null
         ? stepBuilder
         : stepBuilder.Rollback(context => onRollback());
コード例 #5
0
 public static IStepBuilder Teardown(this IStepBuilder stepBuilder, Action <IStepContext> onTeardown) => stepBuilder.Rollback(onTeardown);