public void Given_MoodAnalyserClassName_Should_ReturnMoodAnalyserObject_usingParameterisedConstructor() { object expected = new MoodAnalyser("HAPPY"); object actual = MoodAnalyserFactory.CreateMoodAnalyserUsingParameterizedConstructor("MoodAnalyserApp.MoodAnalyser", "MoodAnalyser", "SAD"); Assert.AreEqual(expected.GetType(), actual.GetType()); }
public void GivenMoodAnalyseClassName_ShouldReturnMoodAnalyserObject_UsingParameterizdConstructor() { object expected = new MoodAnalyser("HAPPY"); object obj = MoodAnalyserFactory.CreateMoodAnalyserUsingParameterizedConstructor("MoodAnalyserProject.MoodAnalyser", "MoodAnalyser", "HAPPY"); expected.Equals(obj); }
public void Given_ImproperConstructorName_MoodAnalyserFactoryWithParameterisedConstructor_Should_ThrowMoodAnalysisException_NO_SUCH_METHOD() { try { object expected = new MoodAnalyser(); object actual = MoodAnalyserFactory.CreateMoodAnalyserUsingParameterizedConstructor("MoodAnalyserApp.MoodAnalyser", "WrongConstructor", "HAPPY"); } catch (MoodAnalyserCustomException e) { Assert.AreEqual("No such Constructor found", e.Message); } }
public void Given_ImproperClassName_MoodAnalyserFactoryWithParameterisedConstructor_Should_ThrowMoodAnalysisException_NO_SUCH_CLASS() { try { object expected = new MoodAnalyser(); object actual = MoodAnalyserFactory.CreateMoodAnalyserUsingParameterizedConstructor("WrongClass", "MoodAnalyser", "SAD"); } catch (MoodAnalyserCustomException e) { Assert.AreEqual("No such class found", e.Message); } }