Beispiel #1
0
        public void SplitTextAndCount_TextWithTwoIdenticalWords_WordsDictionaryWithOneWords(string text)
        {
            CreatedEmptyWordsKeywordsStopwordsDic dics = new CreatedEmptyWordsKeywordsStopwordsDic();

            WordCounter.SplitTextAndCount(text, dics.WordsDictionary, null, null, true);
            int length = dics.WordsDictionary.Count;

            Assert.AreEqual(length, 1);
        }
Beispiel #2
0
        public void SplitTextAndCount_TextWithTwoDifferentWords_WordsDictionaryWithTwoWordsAndOneOccurences(string text)
        {
            CreatedEmptyWordsKeywordsStopwordsDic dics = new CreatedEmptyWordsKeywordsStopwordsDic();

            WordCounter.SplitTextAndCount(text, dics.WordsDictionary, null, null, true);
            int length = dics.WordsDictionary.Count;

            Assert.AreEqual(length, 2);
        }
Beispiel #3
0
        public void SplitTextAndCount_EmptyText_WordsDictionaryEmpty(string text)
        {
            CreatedEmptyWordsKeywordsStopwordsDic dics = new CreatedEmptyWordsKeywordsStopwordsDic();

            WordCounter.SplitTextAndCount(text, dics.WordsDictionary, null, null, true);
            int length = dics.WordsDictionary.Count;

            Assert.AreEqual(length, 0);
        }
Beispiel #4
0
        public void SplitTextAndCount_TextWithTwoIdenticalWords_WordsDictionaryWithOneWordsAndTwoOccurences(string text)
        {
            CreatedEmptyWordsKeywordsStopwordsDic dics = new CreatedEmptyWordsKeywordsStopwordsDic();

            WordCounter.SplitTextAndCount(text, dics.WordsDictionary, null, null, true);
            int occurences = dics.WordsDictionary["abc"];

            Assert.AreEqual(occurences, 2);
        }
Beispiel #5
0
        public void SplitTextAndCount_TextWithTwoDifferentWordsAndOneInStopwords_WordsDictionaryWithOneWord(string text)
        {
            CreatedEmptyWordsKeywordsStopwordsDic dics = new CreatedEmptyWordsKeywordsStopwordsDic();

            dics.StopWordsDictionary.Add("abc", 0);

            WordCounter.SplitTextAndCount(text, dics.WordsDictionary, dics.StopWordsDictionary, null, true);
            int length = dics.WordsDictionary.Count;

            Assert.AreEqual(length, 1);
        }
Beispiel #6
0
        public void SplitTextAndCount_TextWithTwoWordsAndOneInDicAndCanCountOnlyExistsInDic_WordInDicOccurencesIsTwo(string text)
        {
            CreatedEmptyWordsKeywordsStopwordsDic dics = new CreatedEmptyWordsKeywordsStopwordsDic();

            dics.WordsDictionary.Add("abc", 1);

            WordCounter.SplitTextAndCount(text, dics.WordsDictionary, null, null, false);
            int occurences = dics.WordsDictionary["abc"];

            Assert.AreEqual(occurences, 2);
        }