private LocalVariableComponent CreateSubstringFunctionComponent(Object component, VariableType localVariable) { SubstringFunctionType substringFunctionType = (SubstringFunctionType)component; SubStringFunctionComponent subStringFunctionComponent = new SubStringFunctionComponent(substringFunctionType); LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(substringFunctionType.Item, localVariable); subStringFunctionComponent.AddComponent(variableComponent); return(subStringFunctionComponent); }
public void Should_be_possible_to_instantiate_an_SubstringFunctionComponent() { var function = new SubstringFunctionType() { Item = new LiteralComponentType() }; var localVariable = new VariablesTypeVariableLocal_variable() { Item = function }; var factory = new LocalVariableComponentsFactory(null, null); var variableComponent = factory.GetLocalVariableComponent(localVariable); Assert.IsInstanceOfType(variableComponent, typeof(SubStringFunctionComponent)); Assert.IsTrue(((SubStringFunctionComponent)variableComponent).QuantityOfComponents() == 1, "the quantity of component is not expected"); }
public OvalSubstringBuilder(OvalLocalVariableBuilder localVariableBuilder) { this.localVariableBuilder = localVariableBuilder; this.substringFunction = new SubstringFunctionType(); }
public SubStringFunctionComponent(SubstringFunctionType component) { this.component = component; }