Ejemplo n.º 1
0
 public StepBinding(IBindingMethod method, BindingType bindingType, Regex regex, BindingScope bindingScope)
 {
     Method = method;
     BindingType = bindingType;
     Regex = regex;
     BindingScope = bindingScope;
 }
Ejemplo n.º 2
0
 protected bool Equals(BindingType other)
 {
     return string.Equals(Name, other.Name) && string.Equals(FullName, other.FullName);
 }
        private StepBindingNew CreateStepBinding(CodeAttribute2 attr, CodeFunction codeFunction, BindingType bindingType, BindingScopeNew bindingScope)
        {
            try
            {
                IBindingMethod bindingMethod = new VsBindingMethod(codeFunction);

                var regexArg = attr.Arguments.Cast<CodeAttributeArgument>().FirstOrDefault();
                if (regexArg == null)
                    return null;

                var regexString = VsxHelper.ParseCodeStringValue(regexArg.Value, regexArg.Language);
                var regex = new Regex("^" + regexString + "$", RegexOptions.Compiled | RegexOptions.CultureInvariant);

                return new StepBindingNew(bindingMethod, bindingType, regex, bindingScope);
            }
            catch(Exception)
            {
                return null;
            }
        }
 private StepBindingNew GetBingingFromAttribute(CodeAttribute2 codeAttribute, CodeFunction codeFunction, BindingType bindingType, BindingScopeNew bindingScope)
 {
     try
     {
         if (codeAttribute.FullName.Equals(string.Format("TechTalk.SpecFlow.{0}Attribute", bindingType)))
             return CreateStepBinding(codeAttribute, codeFunction, bindingType, bindingScope);
         return null;
     }
     catch(Exception)
     {
         return null;
     }
 }
Ejemplo n.º 5
0
 protected bool Equals(BindingType other)
 {
     return(string.Equals(Name, other.Name) && string.Equals(FullName, other.FullName));
 }