Exemplo n.º 1
0
 public ConcatFunctionComponent(ConcatFunctionType concatFunctionType, IEnumerable<VariableType> variablesOfDefinitions, oval_system_characteristics systemCharacteristics)
 {
     this.variablesOfDefinitions = variablesOfDefinitions;
     this.systemCharacteristics = systemCharacteristics;
     this.concatFunctionType = concatFunctionType;
     this.concatFunction = new OvalConcatFunction(base.components);
 }
Exemplo n.º 2
0
 public ConcatFunctionComponent(ConcatFunctionType concatFunctionType, IEnumerable <VariableType> variablesOfDefinitions, oval_system_characteristics systemCharacteristics)
 {
     this.variablesOfDefinitions = variablesOfDefinitions;
     this.systemCharacteristics  = systemCharacteristics;
     this.concatFunctionType     = concatFunctionType;
     this.concatFunction         = new OvalConcatFunction(base.components);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Creates the concat function component.
        /// </summary>
        /// <param name="component">The component.</param>
        /// <param name="localVariable">The local variable.</param>
        /// <returns></returns>
        private LocalVariableComponent CreateConcatFunctionComponent(Object component, VariableType localVariable)
        {
            ConcatFunctionType      concatFunctionType      = (ConcatFunctionType)component;
            ConcatFunctionComponent concatFunctionComponent = new ConcatFunctionComponent(concatFunctionType, this.variablesOfDefinitions, this.systemCharacteristics);

            for (int i = 0; i < concatFunctionType.Items.Count(); i++)
            {
                LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(concatFunctionType.Items[i], localVariable);
                concatFunctionComponent.AddComponent(variableComponent);
            }
            return(concatFunctionComponent);
        }
Exemplo n.º 4
0
        public void Should_be_possible_to_instantiate_a_FunctionComponent()
        {
            ConcatFunctionType concatFunction = new ConcatFunctionType()
            {
                Items = new object[] { new ObjectComponentType(), new LiteralComponentType() }
            };
            VariablesTypeVariableLocal_variable localVariable = new VariablesTypeVariableLocal_variable()
            {
                Item = concatFunction
            };

            LocalVariableComponentsFactory factory           = new LocalVariableComponentsFactory(null, null);
            LocalVariableComponent         variableComponent = factory.GetLocalVariableComponent(localVariable);

            Assert.IsInstanceOfType(variableComponent, typeof(LocalVariableFunctionComponent));
            Assert.IsTrue(((LocalVariableFunctionComponent)variableComponent).QuantityOfComponents() == 2, "the quantity of component is not expected");
        }
Exemplo n.º 5
0
 public OvalConcatBuilder(OvalLocalVariableBuilder localVariableBuilder)
 {
     this.variableBuilder = localVariableBuilder;
     this.concatFunction  = new ConcatFunctionType();
     this.items           = new List <object>();
 }