Esempio n. 1
0
        private void CleanRepositories()
        {
            AuthorAlarmRepository authorAlarmRepository = new AuthorAlarmRepository();
            PhraseRepository      phraseRepository      = new PhraseRepository();
            EntityRepository      entityRepository      = new EntityRepository();
            SentimentRepository   sentimentRepository   = new SentimentRepository();
            AuthorRepository      authorRepository      = new AuthorRepository();
            AlarmRepository       alarmRepository       = new AlarmRepository();

            authorAlarmRepository.Clear();
            phraseRepository.Clear();
            entityRepository.Clear();
            sentimentRepository.Clear();
            authorRepository.Clear();
            alarmRepository.Clear();
        }
        public void AddSentimentUpdateAlarm()
        {
            EntityAlarmRepository alarmRepository = new EntityAlarmRepository();

            alarmRepository.Clear();

            AuthorRepository authorRepository = new AuthorRepository();

            authorRepository.Clear();

            PhraseRepository phraseRepository = new PhraseRepository();

            phraseRepository.Clear();

            EntityRepository entityRepository = new EntityRepository();

            entityRepository.Clear();

            authorRepository.Add(AUTHOR);

            Phrase    phrase    = new Phrase("i like google", DateTime.Now, AUTHOR);
            Entity    google    = new Entity("google");
            Sentiment sentiment = new Sentiment(SentimentType.POSITIVE, "i like");

            try
            {
                entityRepository.Add(google);
            }
            catch (AnalysisException) { }

            try
            {
                phraseRepository.Add(phrase);
            }
            catch (AnalysisException) { }

            EntityAlarm alarm = new EntityAlarm("1", "1", SentimentType.POSITIVE, google);

            alarmRepository.Add(alarm);

            REPOSITORY.Add(sentiment);

            Assert.AreEqual(alarmRepository.Get(alarm.Id).PostCount, 1);
        }
Esempio n. 3
0
 public void Create()
 {
     repo = new EntityRepository <Holding>(db => db.Holdings);
     repo.Clear();
 }