Ejemplo n.º 1
0
            public void checkForSad()
            {
                obj = new MoodAnalysis("I am in Sad mood");
                string mood = obj.analysisOfMood();

                Assert.AreEqual("Sad", mood);
            }
Ejemplo n.º 2
0
            public void checkForHappy()
            {
                obj = new MoodAnalysis("I am in any mood");
                string mood = obj.analysisOfMood();

                Assert.AreEqual("Happy", mood);
            }
Ejemplo n.º 3
0
            public void forParamterisedConstructor()
            {
                MoodAnalysis obj = new MoodAnalysis("I am in sad mood!");
                MoodAnalyzerReflection <MoodAnalysis> analyser = new MoodAnalyzerReflection <MoodAnalysis>();
                ConstructorInfo returnObject = analyser.ParameterisedConstructor(1);
                object          constructor  = analyser.createMoodAnalyser(returnObject, "MoodAnalysis", "I am in sad mood!");

                Assert.IsInstanceOf(typeof(MoodAnalysis), constructor);
            }
Ejemplo n.º 4
0
 public void checkForNullException()
 {
     obj = new MoodAnalysis(null);
     try
     {
         string mood = obj.analysisOfMood();
     }
     catch (moodAnalysisException exception)
     {
         Assert.AreEqual("Please enter valid mood!", exception.Message);
     }
 }
Ejemplo n.º 5
0
            public void checkForEmptyException()
            {
                string massage = "";

                obj = new MoodAnalysis(massage);
                try
                {
                    string mood = obj.analysisOfMood();
                }
                catch (moodAnalysisException exception)
                {
                    Assert.AreEqual("Mood is empty,Please enter valid mood!", exception.Message);
                }
            }