public OvalTimeDifferenceBuilder(OvalLocalVariableBuilder localVariableBuilder) { this.timeDifference = new TimeDifferenceFunctionType(); // the oval schema constraints this.timeDifference.Items = new object[2]; this.localVariableBuilder = localVariableBuilder; }
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); }
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"); }
public TimeDifferenceFunctionComponent(TimeDifferenceFunctionType timeDifferenceFunctionType) { this.timeDifferenceFunctionType = timeDifferenceFunctionType; }