private Step GetStep(object testObject, MethodNameMatcher matcher, MethodInfo method, bool returnsItsText, object[] inputs = null, RunStepWithArgsAttribute argAttribute = null)
        {
            var stepMethodName = GetStepTitle(method, testObject, argAttribute, returnsItsText);
            var stepAction     = GetStepAction(method, inputs, returnsItsText);

            return(new Step(stepAction, new StepTitle(stepMethodName), matcher.Asserts, matcher.ExecutionOrder, matcher.ShouldReport, new List <StepArgument>()));
        }
        private Step GetStep(object testObject, MethodNameMatcher matcher, MethodInfo method, bool returnsItsText, Example example)
        {
            var stepMethodName = GetStepTitleFromMethodName(method, null);
            var methodParameters = method.GetParameters();
            var inputs = new object[methodParameters.Length];

            for (var parameterIndex = 0; parameterIndex < inputs.Length; parameterIndex++)
            {
                for (var exampleIndex = 0; exampleIndex < example.Headers.Length; exampleIndex++)
                {
                    var methodParameter = methodParameters[parameterIndex];
                    var parameterName = methodParameter.Name;
                    var placeholderMatchesExampleColumn = example.Values.ElementAt(exampleIndex).MatchesName(parameterName);
                    if (placeholderMatchesExampleColumn )
                        inputs[parameterIndex] = example.GetValueOf(exampleIndex, methodParameter.ParameterType);
                }
            }

            var stepAction = GetStepAction(method, inputs.ToArray(), returnsItsText);
            return new Step(stepAction, new StepTitle(stepMethodName), matcher.Asserts, matcher.ExecutionOrder, matcher.ShouldReport, new List<StepArgument>());
        }
        private Step GetStep(object testObject, MethodNameMatcher matcher, MethodInfo method, bool returnsItsText, Example example)
        {
            var stepMethodName   = GetStepTitleFromMethodName(method, null);
            var methodParameters = method.GetParameters();
            var inputs           = new object[methodParameters.Length];

            for (var parameterIndex = 0; parameterIndex < inputs.Length; parameterIndex++)
            {
                for (var exampleIndex = 0; exampleIndex < example.Headers.Length; exampleIndex++)
                {
                    var methodParameter = methodParameters[parameterIndex];
                    var parameterName   = methodParameter.Name;
                    var placeholderMatchesExampleColumn = example.Values.ElementAt(exampleIndex).MatchesName(parameterName);
                    if (placeholderMatchesExampleColumn)
                    {
                        inputs[parameterIndex] = example.GetValueOf(exampleIndex, methodParameter.ParameterType);
                    }
                }
            }

            var stepAction = GetStepAction(method, inputs.ToArray(), returnsItsText);

            return(new Step(stepAction, new StepTitle(stepMethodName), matcher.Asserts, matcher.ExecutionOrder, matcher.ShouldReport, new List <StepArgument>()));
        }
 protected void AddMatcher(MethodNameMatcher matcher)
 {
     _matchers.Add(matcher);
 }
 private Step GetStep(object testObject, MethodNameMatcher matcher, MethodInfo method, bool returnsItsText, object[] inputs = null, RunStepWithArgsAttribute argAttribute = null)
 {
     var stepMethodName = GetStepTitle(method, testObject, argAttribute, returnsItsText);
     var stepAction = GetStepAction(method, inputs, returnsItsText);
     return new Step(stepAction, stepMethodName, matcher.Asserts, matcher.ExecutionOrder, matcher.ShouldReport);
 }
 protected void AddMatcher(MethodNameMatcher matcher)
 {
     _matchers.Add(matcher);
 }