예제 #1
0
        public void TestValidate()
        {
            // No subnodes: Exception is thrown.
            TryInvalidValidate(new ExprLikeNode(true));

            // singe child node not possible, must be 2 at least
            likeNodeNormal = new ExprLikeNode(false);
            likeNodeNormal.AddChildNode(new SupportExprNode(4));
            TryInvalidValidate(likeNodeNormal);

            // test a type mismatch
            likeNodeNormal = new ExprLikeNode(true);
            likeNodeNormal.AddChildNode(new SupportExprNode("sx"));
            likeNodeNormal.AddChildNode(new SupportExprNode(4));
            TryInvalidValidate(likeNodeNormal);

            // test numeric supported
            likeNodeNormal = new ExprLikeNode(false);
            likeNodeNormal.AddChildNode(new SupportExprNode(4));
            likeNodeNormal.AddChildNode(new SupportExprNode("sx"));

            // test invalid escape char
            likeNodeNormal = new ExprLikeNode(false);
            likeNodeNormal.AddChildNode(new SupportExprNode(4));
            likeNodeNormal.AddChildNode(new SupportExprNode("sx"));
            likeNodeNormal.AddChildNode(new SupportExprNode(5));
        }
예제 #2
0
 public ExprLikeNodeForge(
     ExprLikeNode parent,
     bool isNumericValue)
 {
     ForgeRenderable = parent;
     IsNumericValue = isNumericValue;
 }
예제 #3
0
 private void TryInvalidValidate(ExprLikeNode exprLikeRegexpNode)
 {
     try
     {
         exprLikeRegexpNode.Validate(SupportExprValidationContextFactory.MakeEmpty(container));
         Assert.Fail();
     }
     catch (ExprValidationException)
     {
         // expected
     }
 }
예제 #4
0
 public ExprLikeNodeForgeConst(
     ExprLikeNode parent,
     bool isNumericValue,
     LikeUtil likeUtil,
     CodegenExpression likeUtilInit)
     : base(
         parent,
         isNumericValue)
 {
     LikeUtil = likeUtil;
     LikeUtilInit = likeUtilInit;
 }
예제 #5
0
 public ExprLikeNodeForgeNonconst(
     ExprLikeNode parent,
     bool isNumericValue)
     : base(parent, isNumericValue)
 {
 }