public void NumberOfNegativeWordsIsOutput() { var mockLogger = new Mock <ILogger>(); var reporter = new BadWordReporter(mockLogger.Object); reporter.Report("The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting.", new[] { "swine", "bad", "nasty", "horrible" }); mockLogger.Verify(t => t.Output(It.Is <string>(msg => msg == "Total Number of negative words: 2"))); }
public void PhraseIsOutputWithBadWordsFilteredOut(string[] wordList, string phrase, string hashedPhrase) { var mockLogger = new Mock <ILogger>(); var reporter = new BadWordReporter(mockLogger.Object); reporter.Report(phrase, wordList); mockLogger.Verify(t => t.Output(It.Is <string>(msg => msg == hashedPhrase))); }
public void PhraseIsOutput() { var mockLogger = new Mock <ILogger>(); var reporter = new BadWordReporter(mockLogger.Object); reporter.Report("a phrase", new[] { "swine", "bad", "nasty", "horrible" }); mockLogger.Verify(t => t.Output(It.Is <string>(msg => msg == "a phrase"))); }
public void CanDisableBadWordFiltering() { var mockLogger = new Mock <ILogger>(); var reporter = new BadWordReporter(mockLogger.Object); reporter.DisableFiltering(); reporter.Report("a bad word", new [] { "bad" }); mockLogger.Verify(t => t.Output(It.Is <string>(msg => msg == "a bad word"))); }