public void givenMood_WhenSad_ShouldReturnHappy()
        {
            MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility();
            string mood = moodAnalyser.analyseMood("I am in sad mood");

            Assert.AreEqual("sad", mood);
        }
        public void givenMood_WhenHappy_ShouldReturnHappy()
        {
            MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility();
            string mood = moodAnalyser.analyseMood("happy");

            Assert.AreEqual("happy", mood);
        }
        public void givenAnyMood_shouldReturnHappy()
        {
            MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility();
            string mood = moodAnalyser.analyseMood("I am in any mood");

            Assert.AreEqual("happy", mood);
        }
 public void givenEmptyMood_WhenAnalyse_shouldReturnInvalid()
 {
     try
     {
         MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility();
         string mood = moodAnalyser.analyseMood("");
     }
     catch (MoodAnalyserException e)
     {
         Assert.AreEqual(MoodAnalyserException.ExceptionType.INVALID_EXCEPTION, e.Type);
     }
 }
 public void givenEmptyMessage_WhenAnalyseMood_ShouldReturnInvalidException()
 {
     try
     {
         MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility("");
         moodAnalyser.analyseMood();
     }
     catch (MoodAnalyserException e)
     {
         Assert.AreEqual(MoodAnalyserException.ExceptionType.INVALID_MOOD_EXCEPTION, e.type);
     }
 }
Esempio n. 6
0
 public void givenHappyMood_WhenAnalyse_ShouldReturnTrue()
 {
     try
     {
         MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility("happy");
         string mood = moodAnalyser.analyseMood();
         Assert.AreEqual("happy", mood);
     }
     catch (MoodAnalyser.MoodAnalysisException e)
     {
         Assert.AreEqual("please enter proper message", e.Message);
     }
 }
Esempio n. 7
0
 public void givenInvalidMood_WhenAnalyse_ShouldReturnTrue()
 {
     try
     {
         MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility(null);
         string mood = moodAnalyser.analyseMood();
         Assert.AreEqual("happy", mood);
     }
     catch (MoodAnalyser.MoodAnalysisException e)
     {
         Assert.AreEqual(MoodAnalysisException.ExceptionType.INVALID_MOOD, e.type);
     }
 }
 public void givenSadMessage_WhenAnalyse_ShouldReturnSad()
 {
     MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility("this is a Sad message");
     Assert.AreEqual("SAD", moodAnalyser.analyseMood());
 }
 public void givenHappyMessage_WhenAnalyse_ShouldReturnHappy()
 {
     MoodAnalyser.MoodAnalyserUtility moodAnalyser = new MoodAnalyser.MoodAnalyserUtility("this is a Happy message");
     Assert.AreEqual("HAPPY", moodAnalyser.analyseMood());
 }