コード例 #1
0
 /// <summary>
 /// Reduce produces a constraint from the operator and
 /// any arguments. It takes the arguments from the constraint
 /// stack and pushes the resulting constraint on it.
 /// </summary>
 public override void Reduce(ConstraintBuilder.ConstraintStack stack)
 {
     if (RightContext == null || RightContext is BinaryOperator)
     {
         stack.Push(new ThrowsExceptionConstraint());
     }
     else
     {
         stack.Push(new ThrowsConstraint(stack.Pop()));
     }
 }
コード例 #2
0
ファイル: PropOperator.cs プロジェクト: TestCentric/tc-lite
 /// <summary>
 /// Reduce produces a constraint from the operator and
 /// any arguments. It takes the arguments from the constraint
 /// stack and pushes the resulting constraint on it.
 /// </summary>
 /// <param name="stack"></param>
 public override void Reduce(ConstraintBuilder.ConstraintStack stack)
 {
     if (RightContext == null || RightContext is BinaryOperator)
     {
         stack.Push(new PropertyExistsConstraint(name));
     }
     else
     {
         stack.Push(new PropertyConstraint(name, stack.Pop()));
     }
 }
コード例 #3
0
 /// <summary>
 ///     Reduce produces a constraint from the operator and
 ///     any arguments. It takes the arguments from the constraint
 ///     stack and pushes the resulting constraint on it.
 /// </summary>
 public override void Reduce(ConstraintBuilder.ConstraintStack stack)
 {
     if (RightContext == null || RightContext is BinaryOperator)
     {
         stack.Push(new AttributeExistsConstraint(type));
     }
     else
     {
         stack.Push(new AttributeConstraint(type, stack.Pop()));
     }
 }
コード例 #4
0
 public override void Reduce(ConstraintBuilder.ConstraintStack stack)
 {
     if (RightContext == null || RightContext is BinaryOperator)
     {
         stack.Push(new ExtendedExactCountConstraint(expectedCount));
     }
     else
     {
         stack.Push(new ExtendedExactCountConstraint(expectedCount, stack.Pop()));
     }
 }
コード例 #5
0
        /// <summary>
        /// Reduce produces a constraint from the operator and
        /// any arguments. It takes the arguments from the constraint
        /// stack and pushes the resulting constraint on it.
        /// </summary>
        /// <param name="stack"></param>
        public override void Reduce(ConstraintBuilder.ConstraintStack stack)
        {
            IConstraint right = stack.Pop();
            IConstraint left  = stack.Pop();

            stack.Push(ApplyOperator(left, right));
        }
コード例 #6
0
        public override void Reduce(ConstraintBuilder.ConstraintStack stack)
        {
            var top = stack.Pop();

            ((EntityEqualityConstraint)top).ByInterface(type);
            stack.Push(top);
        }
コード例 #7
0
        public override void Reduce(ConstraintBuilder.ConstraintStack stack)
        {
            // Disallow a plain Hurls.Exception, a type must be provided to avoid catching the incorrect exception
            if (stack.Empty)
            {
                throw new InvalidOperationException();
            }

            stack.Push(new HurlsConstraint(stack.Pop()));
        }
コード例 #8
0
 /// <summary>
 /// Reduce produces a constraint from the operator and
 /// any arguments. It takes the arguments from the constraint
 /// stack and pushes the resulting constraint on it.
 /// </summary>
 /// <param name="stack"></param>
 public override void Reduce(ConstraintBuilder.ConstraintStack stack)
 {
     stack.Push(ApplyPrefix(stack.Pop()));
 }
コード例 #9
0
 /// <summary>
 ///     Reduce produces a constraint from the operator and
 ///     any arguments. It takes the arguments from the constraint
 ///     stack and pushes the resulting constraint on it.
 /// </summary>
 /// <param name="stack" />
 public override void Reduce(ConstraintBuilder.ConstraintStack stack)
 {
     stack.Push(new JsonPropertyConstraint(_name, stack.Pop( )));
 }