public void ContentParserMultipleBlackListTest() { // set a simple string containing the word to blacklist. string simpleString = @"[TIMESTAMP] [USERNAME] more than one word is blacklisted here."; // split with whitespace string[] testData = simpleString.Split(' '); // set the blacklist words to "more" and "word". string result = ContentParser.ParseConversationContent(testData, "more, word"); Assert.AreEqual(@"**** than one **** is blacklisted here.", result); }
public void ContentParserSpecialCharactersTest() { // set a complex string containing special characters. string simpleString = @"[TIMESTAMP] [USERNAME] & this < is % used / for \ testing@"; // split with whitespace string[] testData = simpleString.Split(' '); // parse the splitted string. string result = ContentParser.ParseConversationContent(testData); // check if string is as expected. Assert.AreEqual(@"& this < is % used / for \ testing@", result); }
public void ContentParserBlackListTest() { // set a simple string containing the word to blacklist. string simpleString = @"[TIMESTAMP] [USERNAME] one word are blacklisted here."; // split with whitespace string[] testData = simpleString.Split(' '); // set the blacklist word to "word". string result = ContentParser.ParseConversationContent(testData, "word"); // check if string is as expected. Assert.AreEqual(@"one **** are blacklisted here.", result); }
public void ContentParserSimpleTest() { // set a simple string with the given message format. string simpleString = "[TIMESTAMP] [USERNAME] this is used for testing"; // split with whitespace string[] testData = simpleString.Split(' '); // parse the splitted string. string result = ContentParser.ParseConversationContent(testData); // check if string is as expected. Assert.AreEqual("this is used for testing", result); }