public void GivenImproperName_ThrowNoSuchMethodExceptionWhileInvokingMethod(string methodName, string message, string expected) { try { //Arrange //Act string actual = MoodAnalyzerReflection.InvokeAnalyseMood(methodName, message); //Assert Assert.AreEqual(expected, actual); } catch (MoodAnalyzerException ex) { //Act string actual = ex.Message; //Assert Assert.AreEqual(expected, actual); } }
public void GivenProperName_InvokeAnalyseMoodWithReflection(string methodName, string message, string expected) { try { //Arrange //Act string actual = MoodAnalyzerReflection.InvokeAnalyseMood(methodName, message); //Assert Assert.AreEqual(expected, actual); } catch (MoodAnalyzerException ex) { //Act string actual = ex.Message; //Assert Assert.AreEqual(expected, actual); } }