public void GivenHappyMessage_WhenProper_ShouldReturnHappy() { string expected = "Happy"; MoodAnalyserFactory moodAnalyserFactory = new MoodAnalyserFactory(); dynamic mood = moodAnalyserFactory.InvokeMoodAnalyser("AnalyseMood1", "I am in happy mood"); Assert.AreEqual(expected, mood); }
public void GivenHappyMessage_WhenImroper_ShouldThrowException() { try { MoodAnalyserFactory moodAnalyserFactory = new MoodAnalyserFactory(); dynamic mood = moodAnalyserFactory.InvokeMoodAnalyser("Mood", "I am in happy mood"); } catch (MoodAnalyserException e) { Assert.AreEqual(MoodAnalyserException.ExceptionType.NoSuchMethod, e.TYPE); } }