예제 #1
0
        public void AgeGreaterThan26AndLessThan32AndNameContainsUShouldReturnOne()
        {
            PersonFilter filter = PersonFilter.And().ForAgeGreaterThan(26).ForAgeLessThan(32).ForNameContains("u");

            IEnumerable <Person> people = _repository.GetFilteredPeople(filter);

            people.Should().NotBeEmpty().And.HaveCount(1);
            people.Select(person => person.Name).Should().Equal("Susie");
        }
예제 #2
0
        public void AgeGreaterThan30ShouldReturnThree()
        {
            PersonFilter filter = PersonFilter.And().ForAgeGreaterThan(30);

            IEnumerable <Person> people = _repository.GetFilteredPeople(filter);

            people.Should().NotBeEmpty().And.HaveCount(3);
            people.Select(person => person.Name).Should().Equal("John", "Jake", "Cheryl");
        }
예제 #3
0
        public void AgeGreaterThan26AndLessThan32ShouldReturnTwo()
        {
            PersonFilter filter = PersonFilter.And().ForAgeGreaterThan(26).ForAgeLessThan(32);

            IEnumerable <Person> people = _repository.GetFilteredPeople(filter);

            people.Should().NotBeEmpty().And.HaveCount(2);
            people.Select(person => person.Name).Should().Equal("Susie", "Sarah");
        }
예제 #4
0
        public void NameContainsSShouldReturnThree()
        {
            PersonFilter filter = PersonFilter.And().ForNameContains("s");

            IEnumerable <Person> people = _repository.GetFilteredPeople(filter);

            people.Should().NotBeEmpty().And.HaveCount(3);
            people.Select(person => person.Name).Should().Equal("Susie", "Sarah", "Lindsey");
        }