public void IsNotEnabled()
        {
            AlarmEntity alarm = new AlarmEntity("2", "1", SentimentType.POSITIVE, ENTITY);

            Phrase phrase = new Phrase("I like google", YESTERDAY, AUTHOR);

            phrase.AnalyzePhrase(new List <Entity> {
                ENTITY
            }, new List <Sentiment> {
                new Sentiment(SentimentType.POSITIVE, "I like")
            });

            alarm.AnalyzePhrases(new List <Phrase> {
                phrase
            });

            Assert.IsFalse(alarm.IsEnabled());
        }
        public void AnalyzeNoUpdatePostCount()
        {
            AlarmEntity alarm = new AlarmEntity("2", "1", SentimentType.NEGATIVE, ENTITY);

            Phrase phrase = new Phrase("I like google", YESTERDAY.AddDays(-25), AUTHOR);

            phrase.AnalyzePhrase(new List <Entity> {
                ENTITY
            }, new List <Sentiment> {
                new Sentiment(SentimentType.POSITIVE, "I like")
            });

            alarm.AnalyzePhrases(new List <Phrase> {
                phrase
            });

            Assert.AreEqual(alarm.PostCount, 0);
        }
        public void AnalyzePhraseWithoutEntity()
        {
            Entity entity = new Entity("Starbucks");

            AlarmEntity alarm = new AlarmEntity("1", "2", SentimentType.POSITIVE, entity);

            Phrase phrase = new Phrase("I like google", YESTERDAY, AUTHOR);

            phrase.AnalyzePhrase(new List <Entity> {
                ENTITY
            }, new List <Sentiment> {
                new Sentiment(SentimentType.POSITIVE, "I like")
            });

            alarm.AnalyzePhrases(new List <Phrase> {
                phrase
            });

            Assert.AreEqual(alarm.PostCount, 0);
        }
        public void ReAnalyze()
        {
            AlarmEntity alarm = new AlarmEntity("2", "2", SentimentType.POSITIVE, ENTITY);

            Phrase phrase = new Phrase("I like google", YESTERDAY, AUTHOR);

            phrase.AnalyzePhrase(new List <Entity> {
                ENTITY
            }, new List <Sentiment> {
                new Sentiment(SentimentType.POSITIVE, "I like")
            });

            alarm.AnalyzePhrases(new List <Phrase> {
                phrase
            });
            alarm.ReAnalyePhrases(new List <Phrase> {
                phrase
            });

            Assert.AreEqual(alarm.PostCount, 1);
        }