public void GivenHappyMessageWithReflectionShouldReturnHappy() { //Act string actual = MoodAnalyserRefection.SetField("HAPPY", "message"); //Assert Assert.AreEqual("HAPPY", actual); }
public void GivenNullMessageShouldThrowMoodAnalysisCUstomExceptionIndicatingNullMessage() { try { //Act string actual = MoodAnalyserRefection.SetField(null, "message"); } catch (MoodAnalysisCustomException e) { //Assert Assert.AreEqual("Message should not be null.", e.Message); } }
public void GivenImproperFieldNameShouldThrowMoodAnalysisCUstomExceptionIndicatingNoSuchField() { try { //Act string actual = MoodAnalyserRefection.SetField("HAPPY", "wrongName"); } catch (MoodAnalysisCustomException e) { //Assert Assert.AreEqual("NO such field found", e.Message); } }