Пример #1
0
        public void RangeComparisonsMapToExpectedNames()
        {
            var gt = new RangeSpecificationCriteria(RangeComparison.GreaterThan, 1);
            var gte = new RangeSpecificationCriteria(RangeComparison.GreaterThanOrEqual, 1);
            var lt = new RangeSpecificationCriteria(RangeComparison.LessThan, 1);
            var lte = new RangeSpecificationCriteria(RangeComparison.LessThanOrEqual, 1);

            Assert.Equal(gt.Name, "gt");
            Assert.Equal(gte.Name, "gte");
            Assert.Equal(lt.Name, "lt");
            Assert.Equal(lte.Name, "lte");
        }
Пример #2
0
        public void EnumerableConstructorSetsMultipleSpecifications()
        {
            var greater = new RangeSpecificationCriteria(RangeComparison.GreaterThanOrEqual, "D");
            var less = new RangeSpecificationCriteria(RangeComparison.LessThan, "H");

            var criteria = new RangeCriteria("initials", memberInfo, new[] { greater, less });

            Assert.Equal("initials", criteria.Field);
            Assert.Equal(memberInfo, criteria.Member);
            Assert.Contains(greater, criteria.Specifications);
            Assert.Contains(less, criteria.Specifications);
            Assert.Equal(2, criteria.Specifications.Count);
        }