Example #1
0
 public OvalTimeDifferenceBuilder(OvalLocalVariableBuilder localVariableBuilder)
 {
     this.timeDifference = new TimeDifferenceFunctionType();
     // the oval schema constraints
     this.timeDifference.Items = new object[2];
     this.localVariableBuilder = localVariableBuilder;
 }
Example #2
0
        private LocalVariableComponent CreateTimeDifferenceComponent(object component, VariableType localVariable)
        {
            TimeDifferenceFunctionType      timeDifferenceType      = (TimeDifferenceFunctionType)component;
            TimeDifferenceFunctionComponent timeDifferenceComponent = new TimeDifferenceFunctionComponent(timeDifferenceType);

            for (int i = 0; i < timeDifferenceType.Items.Count(); i++)
            {
                LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(timeDifferenceType.Items[i], localVariable);
                timeDifferenceComponent.AddComponent(variableComponent);
            }
            return(timeDifferenceComponent);
        }
Example #3
0
        public void Should_be_possible_to_instantiate_an_TimeDifferenceFunctionComponent()
        {
            var function = new TimeDifferenceFunctionType()
            {
                Items = new object[] { new ObjectComponentType(), new ObjectComponentType() }
            };
            var localVariable = new VariablesTypeVariableLocal_variable()
            {
                Item = function
            };

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

            Assert.IsInstanceOfType(variableComponent, typeof(TimeDifferenceFunctionComponent));
            Assert.IsTrue(((TimeDifferenceFunctionComponent)variableComponent).QuantityOfComponents() == 2, "the quantity of component is not expected");
        }
Example #4
0
 public TimeDifferenceFunctionComponent(TimeDifferenceFunctionType timeDifferenceFunctionType)
 {
     this.timeDifferenceFunctionType = timeDifferenceFunctionType;
 }
 public TimeDifferenceFunctionComponent(TimeDifferenceFunctionType timeDifferenceFunctionType)
 {
     this.timeDifferenceFunctionType = timeDifferenceFunctionType;
 }