public void TestThatFilterOnZReturnsNobody()
 {
     _param.GlobalSearch = "z";
     _filter = new DatatableFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered.Count(), Is.EqualTo(0), "There are no people with the letter 'Z' in their name");
 }
 public void TestThatFilterOnSpecialCharactersDoesntFailAndReturnsNobody()
 {
     _param.GlobalSearch = "&é'(§è!çà)'$^µù=:;~`µ´][*¨\\";
     _filter = new DatatableFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered.Count(), Is.EqualTo(0), "There are no people with a special name like that.");
 }
 public void TestThatFilterOnNameAlexReturnsAlex()
 {
     _param.GlobalSearch = Alex.Name;
     _filter = new DatatableFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered, Is.EquivalentTo(new[] {Alex}), "There's only one person with name Alex");
 }
 public void TestThatFilterOnNameContainingAReturnsAlexAnnAndMatt()
 {
     _param.GlobalSearch = "a";
     _filter = new DatatableFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered, Is.EquivalentTo(new[] {Alex, Ann, Matt}),
                 "Alex, Ann and Matt all have the letter 'a' in their name");
 }
 public void TestThatSearchingForBirthdayWithYear1990ReturnsAlex()
 {
     _param.GlobalSearch = "1990";
     _filter = new DatatableFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered, Is.EquivalentTo(new[] {Alex}));
 }
 public void TestThatNoFilterDoesntChangeTheEntities()
 {
     _filter = new DatatableFilter<Person>(_param, _properties);
     IQueryable<Person> filtered = _filter.Filter(People);
     Assert.That(filtered, Is.EquivalentTo(People),
                 "The filter was empty, the list of people should be unchanged");
 }