protected virtual TimeSpan ExecuteStepMatch(BindingMatch match, object[] arguments) { TimeSpan duration = TimeSpan.Zero; try { _bindingInvoker.InvokeBinding(match.StepBinding, _contextManager, arguments, _testTracer, out duration); } catch (Exception ex) { if (_stepErrorHandlers != null) { StepFailureEventArgs stepFailureEventArgs = new StepFailureEventArgs(match.StepBinding, match.StepContext, ex); foreach (var stepErrorHandler in _stepErrorHandlers) { stepErrorHandler.OnStepFailure(this, stepFailureEventArgs); } if (stepFailureEventArgs.IsHandled) { return(duration); } } throw; } return(duration); }
public virtual void InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType) { var currentContainer = GetHookContainer(hookType); var arguments = ResolveArguments(hookBinding, currentContainer); invoker.InvokeBinding(hookBinding, _contextManager, arguments, _testTracer, out _); }
public void InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType) { var currentContainer = GetHookContainer(hookType); var arguments = ResolveArguments(hookBinding, currentContainer); TimeSpan duration; invoker.InvokeBinding(hookBinding, contextManager, arguments, testTracer, out duration); }
private object DoTransform(IStepArgumentTransformationBinding stepTransformationBinding, object value, CultureInfo cultureInfo) { var parameters = stepTransformationBinding.Method.Parameters.ToArray(); var arguments = GetStepTransformationArguments(stepTransformationBinding, value, cultureInfo) .Select((arg, i) => stepArgumentTypeConverter.Convert(arg, parameters[i].Type, cultureInfo)).ToArray(); TimeSpan duration; return(bindingInvoker.InvokeBinding(stepTransformationBinding, contextManager, arguments, testTracer, out duration)); }
protected virtual void ExecuteStepMatch(BindingMatch match, object[] arguments, out TimeSpan duration) { _testThreadExecutionEventPublisher.PublishEvent(new StepBindingStartedEvent(match.StepBinding)); duration = default; try { _bindingInvoker.InvokeBinding(match.StepBinding, _contextManager, arguments, _testTracer, out duration); } finally { _testThreadExecutionEventPublisher.PublishEvent(new StepBindingFinishedEvent(match.StepBinding, duration)); } }
private object DoTransform(IStepArgumentTransformationBinding stepTransformation, object value, CultureInfo cultureInfo) { object[] arguments; if (stepTransformation.Regex != null && value is string) { arguments = GetStepTransformationArgumentsFromRegex(stepTransformation, (string)value, cultureInfo); } else { arguments = new object[] { value } }; TimeSpan duration; return(bindingInvoker.InvokeBinding(stepTransformation, contextManager, arguments, testTracer, out duration)); }
public virtual void InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType) { var currentContainer = GetHookContainer(hookType); var arguments = ResolveArguments(hookBinding, currentContainer); _testThreadExecutionEventPublisher.PublishEvent(new HookBindingStartedEvent(hookBinding)); TimeSpan duration = default; try { invoker.InvokeBinding(hookBinding, _contextManager, arguments, _testTracer, out duration); } finally { _testThreadExecutionEventPublisher.PublishEvent(new HookBindingFinishedEvent(hookBinding, duration)); } }
protected virtual void ExecuteStepMatch(BindingMatch match, object[] arguments, out TimeSpan duration) { _bindingInvoker.InvokeBinding(match.StepBinding, _contextManager, arguments, _testTracer, out duration); }
public static void InvokeHook(this IBindingInvoker invoker, IHookBinding hookBinding, IContextManager contextManager, ITestTracer testTracer) { TimeSpan duration; invoker.InvokeBinding(hookBinding, contextManager, null, testTracer, out duration); }