private TypeOfStep DetermineTypeOfStep(StringStep stringStep) { var step = stringStep.TypeOfStep; step = (step == TypeOfStep.Unknown) ? _lastTypeOfStep : step; _lastTypeOfStep = step; return step; }
private TypeOfStep DetermineTypeOfStep(StringStep stringStep) { var step = stringStep.TypeOfStep; step = (step == TypeOfStep.Unknown) ? _lastTypeOfStep : step; _lastTypeOfStep = step; return(step); }
public bool Equals(StringStep other) { if (other == null) { return(false); } return((ReferenceEquals(this, other)) || (other.MatchableStep == MatchableStep && other.Source == Source)); }
public Action ResolveStep(StringStep stringStep) { var methodName = stringStep.Step.Replace(' ', '_'); var storyType = _methodProvider.GetType(); var method = storyType.GetMethod(methodName, BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, null, Type.EmptyTypes, null); if (method != null) return () => method.Invoke(_methodProvider, new object[0]); return null; }
public Action ResolveStep(StringStep stringStep) { var actionMethodInfo = _actionCatalog.GetAction(stringStep); if (actionMethodInfo == null) return null; var parameters = _parameterConverter.GetParametersForStep(stringStep); return () => { actionMethodInfo.ExecuteNotificationMethod(typeof(BeforeStepAttribute)); actionMethodInfo.MethodInfo.Invoke(_stepHelper, parameters); actionMethodInfo.ExecuteNotificationMethod(typeof(AfterStepAttribute)); }; }
public void Run(StringStep step) { var stepImplementation = resolvers .Select(resolver => resolver.ResolveStep(step)) .FirstOrDefault(action => action != null); if (stepImplementation == null) { step.PendNotImplemented("No implementation found"); return; } try { stepImplementation(); } catch (Exception ex) { var realException = FindUsefulException(ex); step.Fail(realException); } }
public StepResult(StringStep stringStep, Result resultForActionStep) : base(resultForActionStep.Message) { StringStep = stringStep; Result = resultForActionStep; }
public void AddStep(StringStep step) { _steps.Add(step); }
public void AddStep(string step) { var stringStringStep = new StringStep(step, Source); AddStep(stringStringStep); }
public bool Equals(StringStep other) { if (other == null) return false; return (ReferenceEquals(this, other)) || (other.MatchableStep == MatchableStep && other.Source == Source); }
public void Pend(string reason) { StringStep.Pend(reason); }
public Action ResolveStep(StringStep stringStep) { Action step; return inlineImplementations.TryGetValue(stringStep.Step, out step) ? step : null; }
public string GenerateMethodFor(StringStep step) { return(GenerateMethodFor(step.Step, DetermineTypeOfStep(step))); }
public void Run(StringStep step, Example example) { throw new NotSupportedException("NBehave.Spec does not support example-driven scenarios"); }
public string GenerateMethodFor(StringStep step) { return GenerateMethodFor(step.Step, DetermineTypeOfStep(step)); }