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); }
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)); }
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)); }
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)); }
public void SetUp() { _bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND); }