コード例 #1
0
        /// <summary>
        /// Returns a new DictionaryContainsKeyValuePairConstraint checking for the
        /// presence of a particular key-value-pair in the dictionary.
        /// </summary>
        public DictionaryContainsKeyValuePairConstraint WithValue(object expectedValue)
        {
            var builder = this.Builder;

            if (builder == null)
            {
                builder = new ConstraintBuilder();
                builder.Append(this);
            }

            var constraint = new DictionaryContainsKeyValuePairConstraint(Expected, expectedValue);

            builder.Append(constraint);
            return(constraint);
        }
コード例 #2
0
 /// <summary>
 /// Appends an operator to the expression and returns the
 /// resulting expression itself.
 /// </summary>
 public ConstraintExpression Append(ConstraintOperator op)
 {
     builder.Append(op);
     return(this);
 }