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); }
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); } }