示例#1
0
        public void TestEquals_CheckUpSameUnaryLambdaFuncNodes_ReturnsTrue()
        {
            IASTNode firstValueNode = new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_DIV,
                                                                  new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_ADD, new CValueASTNode(new int[] { 0 })));

            IASTNode secondValueNode = new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_DIV,
                                                                   new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_ADD, new CValueASTNode(new int[] { 0 })));

            Assert.IsTrue(firstValueNode.Equals(secondValueNode));
            Assert.IsTrue(secondValueNode.Equals(firstValueNode));
        }
示例#2
0
        public void TestEquals_CheckUpDifferentUnaryLambdaFuncNodes_ReturnsFalse()
        {
            IASTNode firstValueNode = new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_DIV,
                                                                  new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_ADD, new CValueASTNode(new int[] { 2 })));

            IASTNode secondValueNode = new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_DIV,
                                                                   new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_ADD, new CValueASTNode(new int[] { 0 })));

            Assert.IsFalse(firstValueNode.Equals(secondValueNode));
            Assert.IsFalse(secondValueNode.Equals(firstValueNode));

            firstValueNode = new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_DIV,
                                                         new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_MAX, new CValueASTNode(new int[] { 0 })));

            secondValueNode = new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_DIV,
                                                          new CUnaryLambdaFuncASTNode(E_OPERATION_TYPE.OT_ADD, new CValueASTNode(new int[] { 0 })));

            Assert.IsFalse(firstValueNode.Equals(secondValueNode));
            Assert.IsFalse(secondValueNode.Equals(firstValueNode));
        }