public void FilterUserDataShortNameTest()
        {
            ChatState             state         = new ChatState();
            UserDataFilterService filterService = new UserDataFilterService();

            state.AddPIIText(ChatWeb.Models.PIIType.Low, "mary", "NAME");
            state.AddPIIText(ChatWeb.Models.PIIType.Low, "n", "NAME");

            string testText = "My name is mary n.";

            string filtered = filterService.FilterUserData(state, testText, true);

            Assert.AreEqual(filtered, "My name is <NAME> n.");
        }
Ejemplo n.º 2
0
 protected virtual void CheckIfAnswerHasPII(ChatState state, PIIType piiType, string answer, string mask)
 {
     if ((piiType != PIIType.None) && !String.IsNullOrEmpty(answer))
     {
         state.AddPIIText(piiType, answer, mask);
     }
 }