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()); }
public void GivenMoodANalyserClassName_ShouldReturnWrongConstructorMessage() { try { string message = "Happy"; object expected = new MoodAnalyse(message); object obj = MoodAnalyserFactory.CreateMoodAnalyserWithParameters("MoodAnalyzer.MoodAnalyse", "abc", "Happy"); Assert.AreEqual(expected.GetType(), obj.GetType()); } catch (MoodAnalysisException e) { Assert.AreEqual("No such method", e.Message); } }