예제 #1
0
        public void TestGetType()
        {
            log.Debug(".testGetType");
            _bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
            _bitWiseNode.AddChildNode(new SupportExprNode(typeof(double?)));
            _bitWiseNode.AddChildNode(new SupportExprNode(typeof(int?)));
            try
            {
                _bitWiseNode.Validate(SupportExprValidationContextFactory.MakeEmpty(container));
                Assert.Fail();
            }
            catch (ExprValidationException)
            {
                // Expected
            }

            _bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
            _bitWiseNode.AddChildNode(new SupportExprNode(typeof(long?)));
            _bitWiseNode.AddChildNode(new SupportExprNode(typeof(long?)));
            ExprNodeUtilityValidate.GetValidatedSubtree(
                ExprNodeOrigin.SELECT,
                _bitWiseNode,
                SupportExprValidationContextFactory.MakeEmpty(container));
            Assert.AreEqual(typeof(long?), _bitWiseNode.Forge.EvaluationType);
        }
예제 #2
0
 public void TestEqualsNode()
 {
     log.Debug(".testEqualsNode");
     _bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
     Assert.IsTrue(_bitWiseNode.EqualsNode(_bitWiseNode, false));
     Assert.IsFalse(_bitWiseNode.EqualsNode(new ExprBitWiseNode(BitWiseOpEnum.BXOR), false));
 }
예제 #3
0
 public void TestToExpressionString()
 {
     log.Debug(".testToExpressionString");
     _bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
     _bitWiseNode.AddChildNode(new SupportExprNode(4));
     _bitWiseNode.AddChildNode(new SupportExprNode(2));
     Assert.AreEqual("4&2", ExprNodeUtilityPrint.ToExpressionStringMinPrecedenceSafe(_bitWiseNode));
 }
예제 #4
0
 public ExprBitWiseNodeForge(
     ExprBitWiseNode parent,
     Type resultType,
     BitWiseOpEnum.Computer computer)
 {
     ForgeRenderable = parent ?? throw new ArgumentNullException(nameof(parent));
     EvaluationType = resultType ?? throw new ArgumentNullException(nameof(resultType));
     Computer = computer ?? throw new ArgumentNullException(nameof(computer));
 }
예제 #5
0
 public void SetUp()
 {
     _bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
 }