Example #1
0
        public void Search_WithResultSizeConstraint()
        {
            var searchService = new TestableSecurityManagerSearchServiceBase(QueryFactory.CreateLinqQuery <User>());
            var actual        = searchService.Search(null, _property, CreateSecurityManagerSearchArguments(3));

            Assert.That(actual.Length, Is.EqualTo(3));
        }
Example #2
0
        public void Search_WithResultSizeConstrant_AndWhereConstraint()
        {
            var searchService = new TestableSecurityManagerSearchServiceBase(QueryFactory.CreateLinqQuery <User>().Where(u => u.LastName.Contains("user")));
            var actual        = searchService.Search(null, _property, CreateSecurityManagerSearchArguments(1)).ToArray();

            Assert.That(actual.Length, Is.EqualTo(1));
            Assert.That(((User)actual[0]).LastName, Is.StringContaining("user"));
        }