public void TestThatFilterOnNameContainingAReturnsAlexAnnAndMatt()
 {
     _param.Search[1] = "a";
     _filter = new DatatablePropertyFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered, Is.EquivalentTo(new[] {Alex, Ann, Matt}));
 }
 public void TestThatFilterOnNameAlexReturnsAlex()
 {
     _param.Search[1] = Alex.Name;
     _filter = new DatatablePropertyFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered, Is.EquivalentTo(new[] {Alex}));
 }
예제 #3
0
        public void TestThatNoFilterDoesntChangeTheEntities()
        {
            _filter = new DatatablePropertyFilter <Person>(_param, _properties);
            IQueryable <Person> filtered = _filter.Filter(People);

            Assert.That(filtered, Is.EquivalentTo(People));
        }
예제 #4
0
        public void TestThatFilterOnNameContainingAReturnsAlexAnnAndMatt()
        {
            _param.Search[1] = "a";
            _filter          = new DatatablePropertyFilter <Person>(_param, _properties);
            IQueryable <Person> filtered = _filter.Filter(People);

            Assert.That(filtered, Is.EquivalentTo(new[] { Alex, Ann, Matt }));
        }
예제 #5
0
        public void TestThatFilterOnNameAlexReturnsAlex()
        {
            _param.Search[1] = Alex.Name;
            _filter          = new DatatablePropertyFilter <Person>(_param, _properties);
            IQueryable <Person> filtered = _filter.Filter(People);

            Assert.That(filtered, Is.EquivalentTo(new[] { Alex }));
        }
 public void TestThatNoFilterDoesntChangeTheEntities()
 {
     _filter = new DatatablePropertyFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered, Is.EquivalentTo(People));
 }
예제 #7
0
        /// <summary>
        ///     Applies property-specific filters, if any, to the entities
        /// </summary>
        /// <param name="param">
        ///     The param containing the property filters
        /// </param>
        /// <returns>
        ///     the filtered entities
        /// </returns>
        private IQueryable <TEntity> FilterSpecific(DatatableParam param)
        {
            var filter = new DatatablePropertyFilter <TEntity>(param, _properties);

            return(filter.Filter(_entities));
        }