public void WordFrequencyPreprocessed_ThrowsArgumentNullException_WhenTargetWordIsNull() { // Arrange var book = new[] { "foo" }; Question16_2.PreprocessBook(book); // Act void action() => Question16_2.WordFrequencyPreprocessed(null); // Assert TestHelpers.AssertExceptionThrown(action, typeof(ArgumentNullException)); }
public void WordFrequencyPreprocessed_ReturnsFrequency_WithOneWord() { // Arrange var book = new[] { "foo" }; Question16_2.PreprocessBook(book); // Act var result = Question16_2.WordFrequencyPreprocessed("foo"); // Assert Assert.AreEqual(1, result); }
public void WordFrequencyPreprocessed_ReturnsZero_WithNoOccurrences() { // Arrange var book = new[] { "foo" }; Question16_2.PreprocessBook(book); // Act var result = Question16_2.WordFrequencyPreprocessed("bar"); // Assert Assert.AreEqual(0, result); }