Exemple #1
0
        public void TestAddOperator01()
        {
            Tree tree = new Tree();
            ArithmeticMultiply expression = new ArithmeticMultiply();
            ExprNode           Addexpr    = new ExprNode(expression);

            System.Collections.ArrayList operands = new System.Collections.ArrayList();
            Constant operand1 = new Constant(1);
            ExprNode expr1    = new ExprNode(operand1);
            Constant operand2 = new Constant(2);
            ExprNode expr2    = new ExprNode(operand2);

            operands.Add(expr1);
            operands.Add(expr2);
            Accessor exprAccessor = ReflectionAccessor.Wrap(Addexpr);

            exprAccessor.SetField("_operands", operands);
            BooleanAnd Multiexpression = new BooleanAnd();

            tree.Root = Addexpr;
            Accessor treeAccessor = ReflectionAccessor.Wrap(tree);

            treeAccessor.SetField("_top", Addexpr);
            //Test Procedure Call
            tree.AddOperator(Multiexpression);
        }
Exemple #2
0
        internal static ArithmeticMultiply CreateArithmeticMultiply01()
        {
            ArithmeticMultiply arithmeticMultiply = new ArithmeticMultiply();

            arithmeticMultiply.ToString();
            return(arithmeticMultiply);
        }
Exemple #3
0
        public void TestArithmeticMultiplyConstructor01()
        {
            ArithmeticMultiply arithmeticMultiply = new ArithmeticMultiply();

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record((OperatorPriority)arithmeticMultiply.Priority);
            recorder.FinishRecording();
            #endregion
        }
Exemple #4
0
        public void TestCreateArithmeticMultiply01()
        {
            ArithmeticMultiply arithmeticMultiply = CreateArithmeticMultiply01();

            Assert.IsNotNull(arithmeticMultiply);
            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record((OperatorPriority)arithmeticMultiply.Priority);
            recorder.FinishRecording();
            #endregion
        }
Exemple #5
0
        public void TestAddOperator02()
        {
            Tree tree = new Tree();
            ArithmeticMultiply expression = new ArithmeticMultiply();
            ExprNode           root       = new ExprNode(expression);
            ExprNode           topnode    = new ExprNode(expression);
            ArithmeticSubtract sub        = new ArithmeticSubtract();
            ExprNode           parentnode = new ExprNode(sub);

            tree.Root = root;
            Accessor topAccessor = ReflectionAccessor.Wrap(topnode);

            topAccessor.SetField("_parent", parentnode);
            BooleanAnd booleanAndExpr = new BooleanAnd();
            Accessor   treeAccessor   = ReflectionAccessor.Wrap(tree);

            treeAccessor.SetField("_top", topnode);
            //Test Procedure Call
            tree.AddOperator(booleanAndExpr);
        }