public void WordFrequency_ThrowsArgumentNullException_WhenBookIsNull()
        {
            // Act
            void action() => Question16_2.WordFrequency(null, "foo");

            // Assert
            TestHelpers.AssertExceptionThrown(action, typeof(ArgumentNullException));
        }
        public void WordFrequency_ThrowsArgumentNullException_WhenTargetWordIsNull()
        {
            // Arrange
            var book = new[] { "foo" };

            // Act
            void action() => Question16_2.WordFrequency(book, null);

            // Assert
            TestHelpers.AssertExceptionThrown(action, typeof(ArgumentNullException));
        }
        public void WordFrequency_ReturnsFrequency_WithTwoWords()
        {
            // Arrange
            var book = new[] { "foo", "bar" };

            // Act
            var result = Question16_2.WordFrequency(book, "foo");

            // Assert
            Assert.AreEqual(1, result);
        }
        public void WordFrequency_ReturnsZero_WithNoOccurrences()
        {
            // Arrange
            var book = new[] { "foo" };

            // Act
            var result = Question16_2.WordFrequency(book, "bar");

            // Assert
            Assert.AreEqual(0, result);
        }
        public void WordFrequency_ReturnsFrequency_WithMultipleOccurrences()
        {
            // Arrange
            var book = new[] { "foo", "foo" };

            // Act
            var result = Question16_2.WordFrequency(book, "foo");

            // Assert
            Assert.AreEqual(2, result);
        }