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

            // Act
            var result = AdvancedLinq.FindAllFavouriteColours(people);

            // Assert
            result.Should().NotBeNull();
        }
コード例 #2
0
        public void FindAllFavouriteColours_EmptyList_ReturnsEmptyList()
        {
            // Arrange
            var people = TestData.NoPeople;

            // Act
            var result = AdvancedLinq.FindAllFavouriteColours(people);

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

            // Act
            var result = AdvancedLinq.FindAllFavouriteColours(people);

            // Assert
            var colour = result.Should().ContainSingle().Subject;

            colour.Should().Be(Colour.Blue);
        }
コード例 #4
0
        public void FindAllFavouriteColours_Everyone_ReturnsUniqueColours()
        {
            // Arrange
            var people = TestData.LotsOfPeople;

            // Act
            var result = AdvancedLinq.FindAllFavouriteColours(people);

            // Assert
            result.Should().BeEquivalentTo(new List <Colour>
            {
                Colour.Blue,
                Colour.Orange,
                Colour.Purple,
                Colour.Green
            });
        }