コード例 #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");
        }