示例#1
0
        public void TextToBeComparedTest(string text, int expectedResult, params string[] tags)
        {
            var listOfWords = InitializeListWithWords(text);

            var test = new CompareTextUsingJaccardTestClass(listOfWords, tags);

            Assert.AreEqual(test.TextToBeCompared.Count(), expectedResult);
        }
示例#2
0
        public void MultipleTagsTest(string text, params string[] tags)
        {
            var listOfWords = InitializeListWithWords(text);

            var test = new CompareTextUsingJaccardTestClass(listOfWords, tags);

            CollectionAssert.AreEqual(tags, test.Tags);
        }
示例#3
0
        public void FullImplementationTrueArticleSimilarity(string fileName, string tag, string trueOrFalse, decimal expectedResult,
                                                            params string[] tags)
        {
            string path = GetFilePath(fileName, tag, trueOrFalse);

            var text = new LoadEachWordToList(path);

            var test = new CompareTextUsingJaccardTestClass(text.Words, tags);

            decimal result = Math.Round(test.TrueArticlesSimilarity, 5);

            Assert.AreEqual(expectedResult, result);
        }