Example #1
0
 public static IOperatorTest FromProperty <T>(string propertyName, T value, OperatorTestType operatorTestType, OperatorTestOption operatorTestOptions)
 {
     return(new OperatorTest <T>
     {
         Value = value,
         TestType = operatorTestType,
         TestOptions = operatorTestOptions
     });
 }
Example #2
0
        public static OperatorGroup Build <T>(
            string propertyName, T value,
            OperatorTestType operatorTestType      = OperatorTestType.Equal,
            OperatorTestOption operatorTestOptions = OperatorTestOption.None,

            BinaryOperatorType operatorType     = BinaryOperatorType.Or,
            BinaryOperatorType nextOperatorType = BinaryOperatorType.And)
        {
            return(new OperatorGroup
            {
                PropertyName = propertyName,
                OperatorType = operatorType,
                NextOperatorType = nextOperatorType,
                OperatorTests = new List <IOperatorTest> {
                    OperatorTest.FromProperty(propertyName, value, operatorTestType, operatorTestOptions)
                }
            });
        }
Example #3
0
        public static OperatorGroup Build <T>(
            string propertyName, List <T> values,
            OperatorTestType operatorTestType      = OperatorTestType.Equal,
            OperatorTestOption operatorTestOptions = OperatorTestOption.None,

            BinaryOperatorType operatorType     = BinaryOperatorType.Or,
            BinaryOperatorType nextOperatorType = BinaryOperatorType.And)
        {
            return(new OperatorGroup
            {
                PropertyName = propertyName,
                OperatorType = operatorType,
                NextOperatorType = nextOperatorType,
                OperatorTests = values
                                .Select(x => OperatorTest.FromProperty(propertyName, x, operatorTestType, operatorTestOptions))
                                .ToList()
            });
        }