예제 #1
0
        public void Given_MoodAnalyser_ClassName_ShouldReturn_MoodAnalyseObject()
        {
            object expected = new MoodAnalyser("NULL");
            object obj      = MoodAnalyserFactory.CreateMoodAnalyseMethod("MoodAnalyzer.MoodAnalyser", "MoodAnalyser");

            expected.Equals(obj);
        }
예제 #2
0
        public void GivenInvalidClassName_ShouldThrow_MoodAnalyserException()
        {
            string expected = "Class not Found";

            try
            {
                object obj = MoodAnalyserFactory.CreateMoodAnalyseMethod("MoodAnalyser.sampleClass", "MoodAnalyser");
            }
            catch (MoodAnalyzerCustomException e)
            {
                Assert.AreEqual(expected, e.Message);
            }
        }
예제 #3
0
        public void GivenClass_WhenNotProper_Constructor_ShouldThrow_MoodAnalyserException()
        {
            string expected = "Constructor is not Found";

            try
            {
                object obj = MoodAnalyserFactory.CreateMoodAnalyseMethod("MoodAnalyzer.MoodAnalyser", "sampleClass");
            }
            catch (MoodAnalyzerCustomException e)
            {
                Assert.AreEqual(expected, e.Message);
            }
        }
예제 #4
0
        public void Given_MoodAnalyser__Using_Reflection_ToReturn_defaultConstructor()
        {
            string expected = "Constructor is not Found";

            try
            {
                object obj = MoodAnalyserFactory.CreateMoodAnalyseMethod("MoodAnalyserProblem.MoodAnalyser", "MoodAnalyser");
            }
            catch (MoodAnalyserException ex)
            {
                Assert.AreEqual(expected, ex.Message);
            }
        }