コード例 #1
0
        public void Contains_With_Escape_Empty(string searchText)
        {
            // Arrange
            var source = new EnumerableQuery <Services>(new List <Services> {
                new Services {
                    Name = "My Service 1"
                }
            });

            // Act
            var result = source.ContainsByName(searchText);

            // Assert
            result.Should().BeEmpty();
        }
コード例 #2
0
        public void ContainsPureMethod()
        {
            // Arrange
            var source = new EnumerableQuery <Services>(new List <Services> {
                new Services {
                    Name = "ball"
                }, new Services {
                    Name = "stick"
                }
            });

            // Act
            var result = source.ContainsByName("l");

            // Assert
            result.Should().NotBeEmpty().And.HaveCount(1).And.Contain(x => x.Name == "ball");
        }