Exemple #1
0
        public void NamesOfPeopleOlderThan_EmptyList_ReturnsEmpty()
        {
            // Arrange
            var people = TestData.NoPeople;

            //Act
            var peopleOlderThan = IntermediateLinq.NamesOfPeopleOlderThan(people, 20);

            //Assert
            peopleOlderThan.Should().BeEmpty();
        }
Exemple #2
0
        public void NamesOfPeopleOlderThanThirty_AbbySmith_ReturnsEmpty()
        {
            // Arrange
            var people = TestData.AbbySmith;

            //Act
            var peopleOlderThan = IntermediateLinq.NamesOfPeopleOlderThan(people, 30);

            //Assert
            peopleOlderThan.Should().BeEmpty();
        }
        public void NamesOfPeopleOlderThanTwenty_AllThePeople_ReturnsPeople()
        {
            // Arrange
            var people = TestData.AllThePeople;

            //Act
            var peopleOlderThan = IntermediateLinq.NamesOfPeopleOlderThan(people, 20);

            //Assert
            peopleOlderThan.Should().NotBeNull();
        }
Exemple #4
0
        public void NamesOfPeopleOlderThanTwenty_AbbySmith_ReturnsAbbySmith()
        {
            // Arrange
            var people = TestData.AbbySmith;

            //Act
            var peopleOlderThan = IntermediateLinq.NamesOfPeopleOlderThan(people, 20);

            //Assert
            peopleOlderThan.Should().HaveCount(TestData.AbbySmith.Count);
            peopleOlderThan.Should().BeEquivalentTo("Abby");
        }
Exemple #5
0
        public void NamesOfPeopleOlderThanTwentyFive_LotsOfPeople_ReturnsCorrectPeople()
        {
            // Arrange
            const int expectedCount = 6;

            var people = TestData.LotsOfPeople;

            //Act
            var peopleOlderThan = IntermediateLinq.NamesOfPeopleOlderThan(people, 25);

            //Assert
            peopleOlderThan.Should().HaveCount(expectedCount);
            peopleOlderThan.Should().Contain("Abby");
            peopleOlderThan.Should().Contain("Dani");
            peopleOlderThan.Should().Contain("Ellie");
            peopleOlderThan.Should().Contain("Felicity");
            peopleOlderThan.Should().Contain("George");
            peopleOlderThan.Should().Contain("Ismail");
        }