public void NegativeWordFrequency() { WordCount wc = new WordCount(); WordOccurences results = wc.MostFrequent(-1); }
/// <summary> /// Run the test and compare the output with the test data set. /// </summary> /// <param name="testSet"></param> /// <param name="nRequest">n most frequently occuring words</param> /// <param name="nExpected">the expected number of frequently occuring words, i.e. when nRequest is greater than the number of words</param> private void RunTest(TestData[] testSet, int nRequest, int nExpected) { WordCount wc = new WordCount(); AddTestData(wc, testSet); WordOccurences results = wc.MostFrequent(nRequest); TestResult(results, nExpected, testSet); }
public void ZeroWordFrequency() { WordCount wc = new WordCount(); WordOccurences results = wc.MostFrequent(0); }
public void NoWords() { WordCount wc = new WordCount(); WordOccurences results = wc.MostFrequent(10); Assert.IsTrue(results.Count == 0); }