Пример #1
0
 public void PredicateIsSupported_ShouldPass(Expression <Func <FakeProjection, bool> > predicate)
 {
     //arrange
     //act
     PredicateGuard.PredicateIsSupported(predicate, "predicate");
     //assert
 }
Пример #2
0
        public void PredicateIsSupported_ShouldNotPass(Expression <Func <FakeProjection, bool> > predicate)
        {
            //arrange
            //act
            TestDelegate action = () => PredicateGuard.PredicateIsSupported(predicate, "predicate");

            //assert
            Assert.Catch(typeof(ArgumentException), action);
        }
Пример #3
0
        /*{
         *  return Enumerable.Empty<TInternalProjection>().AsQueryable();
         * }*/

        private void GuardPredicatesContaineOnlyAllowedOperators(IEnumerable <Expression <Func <TProjection, bool> > > predicates)
        {
            var idx = 0;

            foreach (var predicate in predicates)
            {
                PredicateGuard.PredicateIsSupported(predicate, $"{nameof(predicates)}[{idx}]");
                idx++;
            }
        }