Beispiel #1
0
        private LocalVariableComponent CreateEscapeRegexFunctionComponent(object component, VariableType localVariable)
        {
            EscapeRegexFunctionType      escapeRegexFunctionType      = (EscapeRegexFunctionType)component;
            EscapeRegexFunctionComponent escapeRegexFunctionComponent = new EscapeRegexFunctionComponent(escapeRegexFunctionType);
            LocalVariableComponent       variableComponent            = this.InstantiateTheCorrectTypeOfComponent(escapeRegexFunctionType.Item, localVariable);

            escapeRegexFunctionComponent.AddComponent(variableComponent);
            return(escapeRegexFunctionComponent);
        }
Beispiel #2
0
        public void Should_be_possible_to_instantiate_an_EscapeRegexFunctionComponent()
        {
            var function = new EscapeRegexFunctionType()
            {
                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(EscapeRegexFunctionComponent));
            Assert.IsTrue(((EscapeRegexFunctionComponent)variableComponent).QuantityOfComponents() == 1, "the quantity of component is not expected");
        }
 public EscapeRegexFunctionComponent(EscapeRegexFunctionType component)
 {
     this.component = component;
 }
Beispiel #4
0
 public EscapeRegexFunctionComponent(EscapeRegexFunctionType component)
 {
     this.component = component;
 }
Beispiel #5
0
 public OvalEscapeRegexBuilder(OvalLocalVariableBuilder localVariableBuilder)
 {
     this.localVariableBuilder = localVariableBuilder;
     this.escapeRegexFunction  = new EscapeRegexFunctionType();
 }