예제 #1
0
        public static string ToName(PickleStep step)
        {
            var a = CommonConventions.StripBasicParameters(step.Text);
            var b = CommonConventions.TitlizeWords(a);
            var c = CommonConventions.StripToCodeCompliant(b);

            return(c);
        }
예제 #2
0
        public static object[] ToParams(MethodInfo method, PickleStep step)
        {
            var inlines = CommonConventions.ExtractBasicParameters(step.Text)
                          .Cast <Object>();

            var docs = step.Arguments
                       .Select(arg => arg as PickleString)
                       .Where(arg => arg != null)
                       .Select(arg => arg.Content);

            var tables = step.Arguments
                         .Select(arg => arg as PickleTable)
                         .Where(arg => arg != null);

            var values = inlines
                         .Concat(docs)
                         .Concat(tables)
                         .Zip(method.GetParameters(), Tuple.Create)
                         .Select(tuple => CommonConventions.CoerceType(tuple.Item1, tuple.Item2))
                         .ToArray();

            return(values);
        }