Esempio n. 1
0
        private bool NotRecentlyProcessed(CommentChildData comment)
        {
            if (comment == null)
            {
                throw new ArgumentNullException(nameof(comment));
            }

            return(!RecentCommentsIds.Contains(comment.Id));
        }
Esempio n. 2
0
        private void ProcessComment(CommentChildData comment)
        {
            // TEMPORARY MEASURE!! REMOVE IN FINAL!!!
            Console.WriteLine($"{comment.Author} : {comment.Id}");
            Console.WriteLine();


            RecentCommentsIds.Enqueue(comment.Id);
        }
Esempio n. 3
0
        private bool ContainsWordMatch(CommentChildData comment, out WordDetectorResult result)
        {
            if (comment == null)
            {
                throw new ArgumentNullException(nameof(comment));
            }

            // Assign a value to result to return.
            result = default;

            var match = WordDetector.Detect(comment.Body);

            bool containsWordMatch = match.TotalMatches > 0;

            if (containsWordMatch)
            {
                result = match;
            }

            return(containsWordMatch);
        }