コード例 #1
0
        public void givenMoodAnalserObject_WhenAnalyse_shouldReturnsMoodAnalyserObject()
        {
            MoodAnalyesrFactory <MoodAnalyser> obj_mood = new MoodAnalyesrFactory <MoodAnalyser>();
            ConstructorInfo constructorInfo             = obj_mood.GetDefaultConstructor();
            object          obj_compare = obj_mood.GetInstance("MoodAnalyser", constructorInfo);

            Assert.IsInstanceOf(typeof(MoodAnalyser), obj_compare);
        }
コード例 #2
0
 public void givenWrongClassName_WhenAnalyse_shouldReturnsClassNotFoundException()
 {
     try
     {
         MoodAnalyesrFactory <MoodAnalyser> obj_mood = new MoodAnalyesrFactory <MoodAnalyser>();
         ConstructorInfo constructorInfo             = obj_mood.GetDefaultConstructor();
         object          obj_compare = obj_mood.GetInstance("MoodAnalyser", constructorInfo);
     }
     catch (MoodAnalysisException e)
     {
         Assert.AreEqual(MoodAnalysisException.ExceptionType.NO_SUCH_METHOD, e.type);
     }
 }