Exemplo n.º 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());
        }
Exemplo n.º 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());
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
     }
 }