コード例 #1
0
        public void GivenMoodANalyserClassName_ShouldReturnMoodAnalyserObject()
        {
            string message  = null;
            object expected = new MoodAnalyse(message);
            object obj      = MoodAnalyserFactory.CreateMoodAnalyser("MoodAnalyzer.MoodAnalyse", "MoodAnalyse");

            Assert.AreEqual(expected.GetType(), obj.GetType());
        }
コード例 #2
0
        public void GivenMoodANalyserClassName_ShouldReturnMoodAnalyserParameterizedObject()
        {
            string message  = "Happy";
            object expected = new MoodAnalyse(message);
            object obj      = MoodAnalyserFactory.CreateMoodAnalyserWithParameters("MoodAnalyzer.MoodAnalyse", "MoodAnalyse", "Happy");

            Assert.AreEqual(expected.GetType(), obj.GetType());
        }
コード例 #3
0
 public void GivenMoodANalyserClassName_ShouldReturnWrongConstructorException()
 {
     try
     {
         string message  = null;
         object expected = new MoodAnalyse(message);
         object obj      = MoodAnalyserFactory.CreateMoodAnalyser("MoodAnalyzer.MoodAnalyse", "abc");
         Assert.AreEqual(expected.GetType(), obj.GetType());
     }
     catch (MoodAnalysisException e)
     {
         Assert.AreEqual("No such method", e.Message);
     }
 }
コード例 #4
0
 public void GivenMoodANalyserClassName_ShouldReturnWrongClassMessage()
 {
     try
     {
         string message  = "Happy";
         object expected = new MoodAnalyse(message);
         object obj      = MoodAnalyserFactory.CreateMoodAnalyserWithParameters("abc.abc", "abc", "Happy");
         Assert.AreEqual(expected.GetType(), obj.GetType());
     }
     catch (MoodAnalysisException e)
     {
         Assert.AreEqual("No Such Class Found", e.Message);
     }
 }