/// <summary> /// Declares a teardown action (related to this step and/or previous steps) which will be executed /// after all steps in the current scenario have been executed. /// </summary> /// <param name="stepDefinition">The step definition.</param> /// <param name="action">The action.</param> /// <returns> /// An instance of <see cref="IStepDefinition"/>. /// </returns> public static IStepDefinition Teardown(this IStepDefinition stepDefinition, Func <Task> action) { IStepBuilder stepBuilder = stepDefinition; stepBuilder.Teardown(action); return(stepDefinition); }
/// <summary> /// Declares a teardown action (related to this step and/or previous steps) which will be executed /// after all steps in the current scenario have been executed. /// </summary> /// <param name="stepDefinition">The step definition.</param> /// <param name="action">The action.</param> /// <returns> /// An instance of <see cref="IStepDefinition"/>. /// </returns> public static IStepDefinition Teardown(this IStepDefinition stepDefinition, Action <IStepContext> action) { IStepBuilder stepBuilder = stepDefinition; stepBuilder.Teardown(action); return(stepDefinition); }
/// <summary> /// Add a step definition to the currently executing thread. /// </summary> /// <param name="item">The step definition.</param> /// <exception cref="InvalidOperationException"> /// The currently executing thread is not in a step definition context. /// </exception> /// <remarks> /// Before this method is called, the thread must have entered a step definiton context /// with a call to <see cref="EnterStepDefinitionContext"/>. /// </remarks> public static void Add(IStepDefinition item) { if (stepDefinitions == null) { throw new InvalidOperationException("The currently executing thread is not in a step definition context."); } stepDefinitions.Add(item); }
public StepDefinition(IStepDefinition copy) { Id = copy.Id; Field = copy.Field; Data = copy.Data; Successful = copy.Successful; NextStep = copy.NextStep; BankId = copy.BankId; UserId = copy.UserId; PartitionKey = SHA1.Create(UserId.ToString()).ToString(); RowKey = SHA1.Create(BankId.ToString()).ToString(); }