public StepMethodInvoker(StepType stepType, MethodBase method, KeyValuePair <string, object>[] supportedParameters = null)
 {
     Method            = method;
     Type              = stepType;
     Parameters        = method.BindParameters(supportedParameters);
     Name              = new StepName(Type, method.Name, supportedParameters);
     ExceptionExpected = method.AttributeOrDefault <ThrowsAttribute>() != null;
     SourceDescription = string.Format("{0}.{1}", method.DeclaringType.FullName, method.Name);
 }
        public static StepType?GetStepType(MethodBase method)
        {
            var given = method.AttributeOrDefault <GivenAttribute>();

            if (given != null)
            {
                return(StepType.Given);
            }
            var when = method.AttributeOrDefault <WhenAttribute>();

            if (when != null)
            {
                return(StepType.When);
            }
            var then = method.AttributeOrDefault <ThenAttribute>();

            if (then != null)
            {
                return(StepType.Then);
            }
            return(null);
        }
Exemplo n.º 3
0
 public StepMethodInvoker(MethodBase method, KeyValuePair <string, object>[] supportedParameters = null)
     : this(method.AttributeOrDefault <IStepAttribute>().StepType, method, supportedParameters)
 {
 }