public void CorrectlyCalculateTFIDF(string documentA, string documentB, string word, double expectedTfidfOfWordInA) { var wordCollectionA = new WordCollection(); wordCollectionA.AddWords(documentA, 10); wordCollectionA.InitWordPositions(); var wordCollectionB = new WordCollection(); wordCollectionB.AddWords(documentB, 10); wordCollectionB.InitWordPositions(); var documents = new List <WordCollection> { wordCollectionA, wordCollectionB }; var tfidfOfWordInA = wordCollectionA.CalculateTFIDF(word, documents); Assert.Equal(expectedTfidfOfWordInA, tfidfOfWordInA, 5); }