コード例 #1
0
        public int Cleanser_Does_Not_Count_Word_If_Part_Of_Another_Word(string words, string textToClean)
        {
            // Arrange.
            var badWords = GetDisallowedWords(words);

            // Act.
            var cleanser = new ContentConsole.TextCleanser(badWords);
            var count    = cleanser.CountDisallowedWords(textToClean);

            // Assert.
            return(count);
        }
コード例 #2
0
        public string Cleanser_Redacts_Words(string words, string textToClean)
        {
            // Arrange.
            var badWords = GetDisallowedWords(words);

            // Act.
            var cleanser = new ContentConsole.TextCleanser(badWords);
            var cleaned  = cleanser.RedactDisallowedWords(textToClean);

            // Assert.
            return(cleaned);
        }
コード例 #3
0
        public int Cleanser_Counts_Words_Ignoring_Punctuation(string words, string textToClean)
        {
            // Arrange.
            var badWords = GetDisallowedWords(words);

            // Act.
            var cleanser = new ContentConsole.TextCleanser(badWords);
            var count    = cleanser.CountDisallowedWords(textToClean);

            // Assert.
            return(count);
        }