Esempio n. 1
0
        public void TestValidate()
        {
            var castNode = new ExprPropertyExistsNode();

            // Test too few nodes under this node
            try
            {
                castNode.Validate(SupportExprValidationContextFactory.MakeEmpty(container));
                Assert.Fail();
            }
            catch (ExprValidationException)
            {
                // Expected
            }

            castNode.AddChildNode(new SupportExprNode(1));
            try
            {
                castNode.Validate(SupportExprValidationContextFactory.MakeEmpty(container));
                Assert.Fail();
            }
            catch (ExprValidationException)
            {
                // Expected
            }
        }
Esempio n. 2
0
        public void SetupTest()
        {
            _supportExprNodeFactory = SupportExprNodeFactory.GetInstance(container);

            _existsNodes = new ExprPropertyExistsNode[2];

            _existsNodes[0] = new ExprPropertyExistsNode();
            _existsNodes[0].AddChildNode(_supportExprNodeFactory.MakeIdentNode("dummy?", "s0"));

            _existsNodes[1] = new ExprPropertyExistsNode();
            _existsNodes[1].AddChildNode(_supportExprNodeFactory.MakeIdentNode("BoolPrimitive?", "s0"));
        }