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