Beispiel #1
0
        public void TestInvokeMoodAnalysis_ShouldReturnMoodAsPerMessage()
        {
            //Arrange
            string methodName   = "AnalyseMood";
            string message      = "he is sad";
            string expectedMood = "SAD";

            //Add
            string actualMood = MoodAnalysisReflecter.InvokeMoodAnalysis(methodName, message);

            //Assert
            Assert.AreEqual(expectedMood, actualMood);
        }
Beispiel #2
0
        public void TestInvokeMoodAnalysis_WrongMethodName_ThrowMethodNotFoundException()
        {
            //Arrange
            string methodName = "AnalyseMoodWrongName";
            string message    = "he is sad";
            string expected   = "Method not found";
            string actual;

            //Add
            try
            {
                actual = MoodAnalysisReflecter.InvokeMoodAnalysis(methodName, message);
            }
            catch (MoodAnalyserException e)
            {
                actual = e.Message;
            }

            //Assert
            Assert.AreEqual(expected, actual);
        }