private void BuildStepBindingFromMethod(MethodInfo method, ScenarioStepAttribute scenarioStepAttr) { CheckStepBindingMethod(method); var scopeAttrs = Attribute.GetCustomAttributes(method.ReflectedType, typeof(StepScopeAttribute)).Concat( Attribute.GetCustomAttributes(method, typeof(StepScopeAttribute))); if (scopeAttrs.Any()) { foreach (StepScopeAttribute scopeAttr in scopeAttrs) { AddStepBinding(method, scenarioStepAttr, CreateScope(scopeAttr)); } } else { AddStepBinding(method, scenarioStepAttr, null); } }
private void AddStepBinding(MethodInfo method, ScenarioStepAttribute scenarioStepAttr, BindingScope stepScope) { StepBinding stepBinding = new StepBinding(scenarioStepAttr.Type, scenarioStepAttr.Regex, method, stepScope); stepBindings.Add(stepBinding); }