コード例 #1
0
        public void GetFirstNamesOfPeople_SinglePerson_ReturnsListWithSingleName()
        {
            // Arrange
            var people = TestData.AbbySmith;

            //Act
            var names = BasicLinq.GetFirstNamesOfPeople(people);

            //Assert
            names.Should().ContainSingle().Subject.Should().Be("Abby");
        }
コード例 #2
0
        public void GetFirstNamesOfPeople_EmptyList_ReturnsEmptyList()
        {
            // Arrange
            var people = TestData.NoPeople;

            //Act
            var names = BasicLinq.GetFirstNamesOfPeople(people);

            //Assert
            names.Should().BeEmpty();
        }
コード例 #3
0
        public void GetFirstNamesOfPeople_LotsOfPeople_ReturnsListWithAllNames()
        {
            // Arrange
            var people = TestData.LotsOfPeople;

            //Act
            var names = BasicLinq.GetFirstNamesOfPeople(people);

            //Assert
            names.Should().BeEquivalentTo(new List <string>
            {
                "Abby",
                "Bob",
                "Charlie",
                "Dani",
                "Ellie",
                "Felicity",
                "George",
                "Hannah",
                "Ismail",
                "Jake",
                "Lenny"
            });
        }