Example #1
0
        public static bool CompareReferenceArgument(this PredicateArgument argument,
                                                    Func <ReferenceArgument, bool> comparer)
        {
            Contract.Requires(argument != null);
            Contract.Requires(comparer != null);

            var stringArgument = argument as ReferenceArgument;

            return(stringArgument != null && comparer(stringArgument));
        }
Example #2
0
        public static bool CompareContractResultArgument(this PredicateArgument argument,
                                                         Func <ContractResultPredicateArgument, bool> comparer)
        {
            Contract.Requires(argument != null);
            Contract.Requires(comparer != null);

            var contractResultPredicateArgument = argument as ContractResultPredicateArgument;

            Contract.Assert(contractResultPredicateArgument != null);

            return(comparer(contractResultPredicateArgument));
        }
Example #3
0
        public void PredicateArgument_ParseShouldFail()
        {
            // Arrange
            PredicateArgument argument = new PredicateArgument();
            IStringReader     reader   = new StringReader("foo::bar");

            // Act
            ReadResults readResults = argument.Parse(reader, out _);

            // Assert
            Assert.IsFalse(readResults.Successful);
        }
Example #4
0
 public ExpressionPredicateCheck(PredicateArgument argument, ICSharpExpression expression)
     : base(argument)
 {
     Contract.Requires(expression != null);
     _expression = expression;
 }
 private EnumValidationPredicateCheck(PredicateArgument argument, IClrTypeName callSiteType) 
     : base(argument, callSiteType)
 {
     Contract.Assert(IsEnum(callSiteType));
 }
 protected MethodCallPredicateCheck(PredicateArgument argument, IClrTypeName callSiteType)
     : base(argument)
 {
     Contract.Requires(callSiteType != null);
     CallSiteType = callSiteType;
 }
Example #7
0
        protected PredicateCheck(PredicateArgument argument)
        {
            Contract.Requires(argument != null);

            _argument = argument;
        }
Example #8
0
 private EnumValidationPredicateCheck(PredicateArgument argument, IClrTypeName callSiteType)
     : base(argument, callSiteType)
 {
     Contract.Assert(IsEnum(callSiteType));
 }
 protected MethodCallPredicateCheck(PredicateArgument argument, IClrTypeName callSiteType) 
     : base(argument)
 {
     Contract.Requires(callSiteType != null);
     CallSiteType = callSiteType;
 }
 private EqualityExpressionPredicateCheck(PredicateArgument argument) 
     : base(argument)
 {}
 public ExpressionPredicateCheck(PredicateArgument argument, ICSharpExpression expression)
     : base(argument)
 {
     Contract.Requires(expression != null);
     _expression = expression;
 }
Example #12
0
 private EqualityExpressionPredicateCheck(PredicateArgument argument)
     : base(argument)
 {
 }