public void AddProperty(IPropertyGenerator property) { if (this.m_properties == null) { this.m_properties = new List <IPropertyGenerator>(); } this.m_properties.Add(property); }
public InterfaceGenerator(AccessEnum access, string typeText, IMethodSignatureGenerator methodSigGenerator, IPropertyGenerator propertyGenerator) { Access = access; TypeText = typeText; _methodSignatureGenerator = methodSigGenerator as MethodSignatureGenerator; _propertyGenerator = propertyGenerator as PropertyGenerator; }
public string[] GenerateHelpers(string className, string propName, IPropertyGenerator generator) { StringBuilder builder = new StringBuilder(); string propertyName = generator.GetPropertyName(Type, propName); string helper = builder.AppendLine($"public {className} Select{propName}(string value)") .AppendLine("{") .AppendLine($"{propertyName}.SelectByValue(value)") .AppendLine("}") .ToString(); return(new[] { helper }); }
public string[] GenerateHelpers(string className, string selector, IPropertyGenerator generator) { string propName = SelectorUtils.GetClassOrPropNameFromSelector(selector); string propertyNameFromGenerator = generator.GetPropertyName(Type, propName); string methodPropName = TextUtils.UppercaseFirst(propName); StringBuilder builder = new StringBuilder(); string helper = builder .AppendLine($"public {className} With{methodPropName}(string {propName})") .AppendLine("{") .AppendLine($"{propertyNameFromGenerator}.SendKeys({propName});") .AppendLine("return this;") .AppendLine("}") .ToString(); return(new [] { helper }); }
public CodeGenerator(TemplateEnum fixtureTemplate, string testText, string methodText, string propertyText, string typeText, string assertText) { var access = AccessEnum.@public; TestFixtureTemplate = fixtureTemplate; TestText = testText; MethodText = methodText; PropertyText = propertyText; TypeText = typeText; AssertText = assertText; _assertGenerator = new AssertGenerator(assertText); _methodGenerator = new MethodGenerator(_assertGenerator, testText); _methodSignatureGenerator = new MethodSignatureGenerator(access, methodText); _propertGenerator = new PropertyGenerator(access, propertyText); _interfaceGenerator = new InterfaceGenerator(access, typeText, _methodSignatureGenerator, _propertGenerator); }
protected ClassGenerator(IClassBuilder classBuilder, IPropertyGenerator propertyGenerator, IAddinContainer container, string namespaceName) { _classBuilder = classBuilder; BaseUsings = new List <string> { "System", "OpenQA.Selenium", "System.Linq" }; ExtraProperties = new List <string>(); ExtraMethods = new List <string>(); Container = container; NamespaceName = namespaceName; PropertyGenerator = propertyGenerator; CtorBulk = new StringBuilder(); }
public string[] GenerateHelpers(string className, string selector, IPropertyGenerator generator) { string[] parts = selector.Split('-'); //auto-button-name-newComp string propName = parts[2]; string propertyName = generator.GetPropertyName(Type, propName); string returnedClass = parts.Length == 4 ? parts[3] : className; string returnStatement = parts.Length == 4 ? "this" : $"new {returnedClass}({Consts.DRIVER_FIELD_NAME})"; StringBuilder builder = new StringBuilder(); string helper = builder.AppendLine($"public {returnedClass} Click{propName}()") .AppendLine("{") .AppendLine($"{propertyName}.Click();") .AppendLine($"return {returnStatement}") .AppendLine("}") .ToString(); return(new[] { helper }); }
public string[] GenerateHelpers(string className, string propName, IPropertyGenerator generator) { return(new string[] { }); }
public string[] GenerateHelpers(string className, string selector, IPropertyGenerator generator) => new string[] { };
public ComponentGenerator(IClassBuilder builder, IPropertyGenerator propertyGenerator, IAddinContainer container, string namespaceName, string parentElementFieldName) : base(builder, propertyGenerator, container, namespaceName) { _parentElementFieldName = parentElementFieldName; }
public string[] GenerateHelpers(string className, string selector, IPropertyGenerator generator) { return(_helpers(className, selector, generator)); }