public void GivenSadMoodReturnSad()
        {
            //Arrange
            MoodAnalyze moodAnalyze = new MoodAnalyze();
            //Act
            var result = moodAnalyze.analyzeMood("I am in Sad Mood");

            //Assert
            Assert.AreEqual("SAD", result);
        }
        public void GivenHappyMoodInConstructorReturnHappy(string message)
        {
            //Arrange
            MoodAnalyze moodAnalyze = new MoodAnalyze(message);
            //Act
            var result = moodAnalyze.analyzeMood();

            //Assert
            Assert.AreEqual("HAPPY", result);
        }
Exemple #3
0
        public void TestMethod4(string message)
        {
            //Arrange
            MoodAnalyze moodAnalyze = new MoodAnalyze(message);
            //Act
            var result = moodAnalyze.AnalyzeMood();

            //Assert
            Assert.AreEqual("HAPPY", result);
        }
        public void GivenHappyMoodReturnHappy()
        {
            //Arrange
            MoodAnalyze moodAnalyze = new MoodAnalyze();
            //Act
            var result = moodAnalyze.analyzeMood("I am in Happy Mood");

            //Assert
            Assert.AreEqual("HAPPY", result);
        }
Exemple #5
0
        public void TestMethod2()
        {
            //Arrange
            MoodAnalyze moodAnalyze = new MoodAnalyze();
            //Act
            var result = moodAnalyze.AnalyzeMood("I am in Happy Mood");

            //Assert
            Assert.AreEqual("HAPPY", result);
        }
Exemple #6
0
        public void TestMethod1()
        {
            //Arrange
            MoodAnalyze moodAnalyze = new MoodAnalyze();
            //Act
            var result = moodAnalyze.AnalyzeMood("I am in Sad Mood");

            //Assert
            Assert.AreEqual("SAD", result);
        }
Exemple #7
0
        public void GivenMoodAnalyzeClassName_ShouldReturnMoodAnalyseObject()
        {
            //Arrange
            string message  = null;
            object expected = new MoodAnalyze(message);
            //Act
            object obj = MoodAnalyserFactory.CreateMoodAnalyserObject("MoodAnalyzer.MoodAnalyze", "MoodAnalyze");

            //Assert
            expected.Equals(obj);
        }
        public void GivenMoodAnalyseClassName_ShouldReturnMoodAnalyseObject()
        {
            //Arrange
            string message  = null;
            object expected = new MoodAnalyze(message);
            //Act
            object obj = MoodAnalyzerFactory.CreateMoodAnalyser("MoodAnalyzerProblem.MoodAnalyze", "MoodAnalyze");

            //Assert
            expected.Equals(obj);
            Assert.AreEqual(expected.GetType(), obj.GetType());
        }
 public void GivenEmptyMoodThrowMoodAnalyzerExceptionEmptyMessage(string message)
 {
     try
     {
         //Arrange
         MoodAnalyze moodAnalyze = new MoodAnalyze(message);
         //Act
         var result = moodAnalyze.analyzeMood();
     }
     catch (MoodAnalyzerException e)
     {
         //Assert
         Assert.AreEqual("Mood should not be empty", e.Message);
     }
 }
Exemple #10
0
 public void TestMethod6(string message)
 {
     try
     {
         //Arrange
         MoodAnalyze moodAnalyze = new MoodAnalyze(message);
         //Act
         var result = moodAnalyze.AnalyzeMood();
     }
     catch (MoodAnalyzeException e)
     {
         //Assert
         Assert.AreEqual("Mood should not be empty", e.Message);
     }
 }
 public void GivenMoodAnalyzeImproperConstructorName_ShouldThrowMoodAnalysisException()
 {
     try
     {
         //Arrange
         string message  = null;
         object expected = new MoodAnalyze(message);
         //Act
         object obj = MoodAnalyzerFactory.CreateMoodAnalyser("MoodAnalyzerProblem.MoodAnalyze", "MoodAnalyz");
     }
     catch (MoodAnalyzerException e)
     {
         //Assert
         Assert.AreEqual("Constructor is not found", e.Message);
     }
 }
Exemple #12
0
 public void GivenMoodAnalyzeImproperConstructorName_ShouldThrowMoodAnalysisExceptionForParameterisedConstructor()
 {
     try
     {
         //Arrange
         string message  = null;
         object expected = new MoodAnalyze(message);
         //Act
         object obj = MoodAnalyserFactory.CreateMoodAnalyserObjectUsingParameterisedConstructor("MoodAnalyzer.MoodAnalyze", "ModAnalize", message);
     }
     catch (MoodAnalyzeException e)
     {
         //Assert
         Assert.AreEqual("constructor not found", e.Message);
     }
 }
Exemple #13
0
 public void GivenMoodAnalyzeImproperClassName_ShouldThrowMoodAnalysisException()
 {
     try
     {
         //Arrange
         string message  = null;
         object expected = new MoodAnalyze(message);
         //Act
         object obj = MoodAnalyserFactory.CreateMoodAnalyserObject("MoodAnalyzer.ModAnalize", "ModAnalize");
     }
     catch (MoodAnalyzeException e)
     {
         //Assert
         Assert.AreEqual("class not found", e.Message);
     }
 }