public void Given_Happy_UsingReflection_When_Proper_Should_Return_HAPPYMood() { object expected = new MoodAnalyser("HAPPY"); object obj = MoodAnalyserReflector.InvokeAnalyseMood("AnalyseMood", "HAPPY"); expected.Equals(obj); }
public void GivenHappyMessage_ShouldReturnHappyMood() { string expected = "Happy"; string result = MoodAnalyserReflector.InvokeAnalyseMood("Happy", "AnalyseMood"); Assert.AreEqual(expected, result); }
public void GivenMessage_ShouldReturnMood() { string message = "I am feeling happy"; string expected = "HAPPY"; string result = MoodAnalyserReflector.InvokeAnalyseMood(message, "analyseMood"); Assert.AreEqual(expected, result); }
public void GivenHappyMessage_InvokeAnalyseMoodMethod_ShouldReturnHappyMoodMessage() { //Arrange string expected = "Happy Mood"; //Act string actual = MoodAnalyserReflector.InvokeAnalyseMood("Happy", "AnalyseMood"); //Assert Assert.AreEqual(expected, actual); }
public void GivenMessage_WhenImproperMethodName_UsingReflection_ShouldThrowMoodAnalysisException() { try { string message = MoodAnalyserReflector.InvokeAnalyseMood("I am in Happy Mood", "Analyse"); } catch (MoodAnalyserException exception) { Assert.AreEqual(MoodAnalyserException.ExceptionType.NO_SUCH_METHOD, exception.exceptionType); } }
public void GivenImproperMethod_ShouldThrowMoodAnalyserCustomException() { try { string result = MoodAnalyserReflector.InvokeAnalyseMood("Happy", "Analyse"); } catch (MoodAnalyserCustomException e) { Assert.AreEqual("No such method found", e.Message); } }
public void HappyMessage_Returns_ImproperMethodException_When_ImproperMethodCalled() { try { string result = MoodAnalyserReflector.InvokeAnalyseMood("Happy", "Check"); } catch (MoodAnalyserCustomException e) { Assert.AreEqual("No such method found", e.Message); } }
public void Given_HappyMessage_When_Improper_MethodName_Should_Throw_MoodAnalysisException() { string expected = "HAPPY"; try { object MoodAnalyserObject = MoodAnalyserReflector.InvokeAnalyseMood("DemoMethod", "HAPPY"); } catch (AnalyserCustomExceptions e) { Assert.AreEqual(expected, e.Message); } }
public void GivenHappyMessage_WhenImproperMethod_ShouldThrowMoodAnalysisException() { try { //Act object result = MoodAnalyserReflector.InvokeAnalyseMood("Happy", "AnalyseMoodDifferent"); } catch (MoodAnalyserCustomException exception) { //Assert Assert.AreEqual("Exception: method not found", exception.Message); } }
public void GivenMessage_WhenHappy_UsingReflection_ShouldReturnHappy() { string message = MoodAnalyserReflector.InvokeAnalyseMood("I am in Happy Mood", "AnalyseMood"); Assert.AreEqual("HAPPY", message); }
public void HappyMessage_Returns_Happy() { string actual = MoodAnalyserReflector.InvokeAnalyseMood("Happy", "CheckMood"); Assert.AreEqual("HAPPY", actual); }