public void TestMethodGivenHappyMessageUsingReflectionWhenProperShouldReturnHappy() { //Arrange string message = "HAPPY"; string methodName = "AnalyseMood"; //Act string actual = MoodAnalyserFactory.AnalyseMood(message, methodName); //Assert Assert.AreEqual("HAPPY", actual); }
public void TestMethodGivenImproperMethodNameShouldThrowMoodAnalysisExceptionIndicatingNoSuchMethod() { try { //Arrange string message = "HAPPY"; string methodName = "WrongMethodName"; //Act string actual = MoodAnalyserFactory.AnalyseMood(message, methodName); } catch (MoodAnalysisException e) { //Assert Assert.AreEqual("no such method", e.Message); } }