Пример #1
0
            public void ShouldReturnInputWhenBacklistIsEmpty()
            {
                // Arrange
                var input = new Dictionary <string, int>
                {
                    { "one", 1 },
                    { "two", 2 },
                    { "three", 3 }
                };

                var sut = new WordBlacklist(Enumerable.Empty <string>());

                // Act
                var actual = sut.Process(input);

                // Assert
                Assert.Equal(input, actual);
            }
Пример #2
0
            public void ShouldReturnInputListWhenBlacklistOnlyHasDifferentEntries()
            {
                // Arrange
                var input = new Dictionary <string, int>
                {
                    { "one", 1 },
                    { "two", 2 },
                    { "three", 3 }
                };

                var blackList = new[] { "four" };
                var sut       = new WordBlacklist(blackList);

                // Act
                var actual = sut.Process(input);

                // Assert
                Assert.Equal(input, actual);
            }
Пример #3
0
            public void ShouldOnlyRemoveBlacklistedWords()
            {
                // Arrange
                var input = new Dictionary <string, int>
                {
                    { "one", 1 },
                    { "two", 2 },
                    { "three", 3 }
                };

                var blackList = new[] { "two" };
                var sut       = new WordBlacklist(blackList);

                // Act
                var actual = sut.Process(input);

                // Assert
                Assert.DoesNotContain("two", actual.Keys);
                Assert.Contains("one", actual.Keys);
                Assert.Contains("three", actual.Keys);
            }