public override void visit(Generated.Expectation obj, bool subNodes)
        {
            Tests.Expectation expect = obj as Tests.Expectation;

            if (expect != null)
            {
                try
                {
                    expect.Messages.Clear();
                    if (!expect.Expression.Contains("%"))
                    {
                        Interpreter.Expression expression = checkExpression(expect, expect.Expression);
                        if (!expect.EFSSystem.BoolType.Match(expression.GetExpressionType()))
                        {
                            expect.AddError("Expression type should be Boolean");
                        }
                    }
                    if (expect.getCondition() != null && !expect.getCondition().Contains("%"))
                    {
                        Interpreter.Expression expression = checkExpression(expect, expect.getCondition());
                        if (!expect.EFSSystem.BoolType.Match(expression.GetExpressionType()))
                        {
                            expect.AddError("Condition type should be Boolean");
                        }
                    }
                }
                catch (Exception exception)
                {
                    expect.AddException(exception);
                }
            }

            base.visit(obj, subNodes);
        }
Example #2
0
        public override void visit(Generated.Expectation obj, bool visitSubNodes)
        {
            Tests.Expectation expectation = (Tests.Expectation)obj;

            if (Rebuild)
            {
                expectation.ExpressionTree = null;
                expectation.ConditionTree  = null;
            }

            // Side effect : compiles or recompiles the expressions
            DataDictionary.Interpreter.Expression expression = expectation.ExpressionTree;
            DataDictionary.Interpreter.Expression condition  = expectation.ConditionTree;

            base.visit(obj, visitSubNodes);
        }
Example #3
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Expectation obj, bool visitSubNodes)
        {
            if (obj.getValue() != null)
            {
                obj.setValue(obj.getValue().Trim());
            }
            if (obj.getCondition() != null)
            {
                obj.setCondition(obj.getCondition().Trim());
            }
            if (obj.getComment() != null)
            {
                obj.setComment(obj.getComment().Trim());
            }

            base.visit(obj, visitSubNodes);
        }
Example #4
0
        /// <summary>
        /// Counts the number of checks
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Expectation obj, bool visitSubNodes)
        {
            Checks += 1;

            base.visit(obj, visitSubNodes);
        }