public void CheckBadWordList() { var sut = new BadWordService(_badWords); var badWords = sut.GetBadWordList(); Assert.That(badWords == "swine,bad,nasty,horrible"); }
public void TestStory2Output() { var injectService = new BadWordService(_badWords); var sut = new AppService(injectService); var output = sut.UpdateBadWordList("swine,bad,nasty,horrible,smelly,stinky,ugly"); Assert.That(output == "New bad word list set, there are now 7 bad words."); }
public void TestStory3Output() { var injectService = new BadWordService(_badWords); var sut = new AppService(injectService); var output = sut.NegativeWordFilter( "The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting."); Assert.That(output == "Filtered text: The weather in Manchester in winter is b#d. It rains all the time - it must be h######e for people visiting."); }
public void TestStory1Output() { var injectService = new BadWordService(_badWords); var sut = new AppService(injectService); var output = sut.NegativeWordCounter( "The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting."); Assert.That(output == "Scanned the text: The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting.\r\nTotal Number of negative words: 2"); }
public void CheckSetBadWordList() { var sut = new BadWordService(_badWords); sut.SetBadWordList("swine,bad,nasty,horrible,smelly,stinky,ugly"); var badWords = sut.GetBadWordList(); Assert.That(badWords == "swine,bad,nasty,horrible,smelly,stinky,ugly"); }
public void CheckBadWordFilter() { var sut = new BadWordService(_badWords); var content = "The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting."; var filteredText = sut.FilterContentForBadWords(content); Assert.That(filteredText == "The weather in Manchester in winter is b#d. It rains all the time - it must be h######e for people visiting."); }
public void CheckBadWordCounter() { var sut = new BadWordService(_badWords); var content = "The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting."; var badWordCount = sut.GetBadWordCount(content); Assert.That(badWordCount == 2); }
public void Init() { badWordService = new BadWordService(); }