public void GivenMoodAnalyserWithoutMessage_WhenAnalysed_UsingParameterizedConstructor_ShouldReturnMoodAnalyserObject() { object expected = new MoodAnalyserClass(); object actual = MoodAnalyserFactory.CreateMoodAnalyserUsingParameterisedConstructor("MoodAnalyser.MoodAnalyserClass", "MoodAnalyserClass"); Assert.AreEqual(expected.GetType(), actual.GetType()); }
public void Given_MoodAnalyserClassName_Should_ReturnMoodAnalyserObject_UsingParameters() { object expected = new MoodAnalyserClass("HAPPY"); object actual = MoodAnalyserFactory.CreateMoodAnalyserUsingParameterisedConstructor("MoodAnalyser.MoodAnalyserClass", "MoodAnalyserClass", "HAPPY"); actual.Equals(expected); }
public void GivenImproperConstructorName_WhenAnalyse_UsingParameterisedConstructor_ShouldThrowMoodAnalysisException() { try { object expected = new MoodAnalyserClass(); object actual = MoodAnalyserFactory.CreateMoodAnalyserUsingParameterisedConstructor("MoodAnalyser.MoodAnalyserClass", "Mood", "Happy"); } catch (MoodAnalyserCustomException e) { Assert.AreEqual("Constructor is not found", e.Message); } }