public void Should_be_possible_to_instantiate_an_ArithmeticFunctionComponent()
        {
            var function = new ArithmeticFunctionType() { Items = new object[] { new ObjectComponentType(), new LiteralComponentType() } };
            var localVariable = new VariablesTypeVariableLocal_variable() { Item = function };

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

            Assert.IsInstanceOfType(variableComponent, typeof(ArithmeticFunctionComponent));
            Assert.IsTrue(((ArithmeticFunctionComponent)variableComponent).QuantityOfComponents() == 2, "the quantity of component is not expected");
        }
 private VariablesTypeVariableLocal_variable GetLocalVariableForAddOperationWithLiteralComponentTypeInt()
 {
     LiteralComponentType literalComponent1 = new LiteralComponentType() { Value = 10.ToString(),  datatype = SimpleDatatypeEnumeration.@int };
     LiteralComponentType literalComponent2 = new LiteralComponentType() { Value = 10.ToString(), datatype = SimpleDatatypeEnumeration.@int };
     ArithmeticFunctionType arithmeticFunctionType = new ArithmeticFunctionType() { arithmetic_operation = ArithmeticEnumeration.add, Items = new [] { literalComponent1, literalComponent2 } };
     VariablesTypeVariableLocal_variable localVariable = new VariablesTypeVariableLocal_variable() { Item = arithmeticFunctionType };
     return localVariable;
 }
示例#3
0
 public OvalArithmeticBuilder(OvalLocalVariableBuilder localVariableBuilder)
 {
     this.localVariableBuilder = localVariableBuilder;
     this.arithmeticFunction = new ArithmeticFunctionType();
     this.items = new List<Object>();
 }