コード例 #1
0
        public void TestUnicodeVietnamese()
        {
            var badText      = "Đây là 1 câu nói bậy.";
            var censoredText = "Đây là 1 **** nói ****.";

            profanity.LoadCensorWords(new List <string>()
            {
                "câu", "bậy"
            });
            Assert.AreEqual(censoredText, profanity.Censor(badText));
        }
コード例 #2
0
        public void TestUnicodeCensorship()
        {
            var badText      = "соседский мальчик сказал хайль и я опешил.";
            var censoredText = "соседский мальчик сказал **** и я опешил.";

            profanity.LoadCensorWords(new List <string>()
            {
                "хайль"
            });
            Assert.AreEqual(censoredText, profanity.Censor(badText));
        }
コード例 #3
0
ファイル: Tests.cs プロジェクト: Raymonf/ProfanityFilter
 public void TestCensor()
 {
     Assert.True(profanity.Censor("Censor me harder daddy") == "Censor me harder daddy");
     Assert.True(profanity.Censor("Eat shit, twat!") == "Eat ****, ****!");
 }
コード例 #4
0
        public void TestLeavesParagraphsUntouched()
        {
            var innocentText = @"If you prick us do we not bleed?
                If you tickle us do we not laugh?
                If you poison us do we not die?
                And if you wrong us shall we not revenge?";
            var censoredText = profanity.Censor(innocentText);

            Assert.AreEqual(censoredText, innocentText);
        }