Пример #1
0
        public void GivenMoodAnalyseClass_ShouldReturn_MoodAnalyserObject_UsingParameterizedConstrucor(string message)
        {
            object expected = new MoodAnalyser(message);
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyserUsingParameterisedConstructors("MoodAnalyserProblem2.MoodAnalyser", "MoodAnalyser", message);

            expected.Equals(obj);
        }
Пример #2
0
        public void GivenMoodAnalyseClassName_ShouldReturnMoodAnalyseObject_UsingParameterizedConstructor()
        {
            object expected = new MoodAnalyser("HAPPY");
            object obj      = MoodAnalyserFactory.CreateMoodAnalyseUsingParameterizedConstructor("MoodAnalyserAppWithCore.MoodAnalyser", "MoodAnalyser", "SAD");

            expected.Equals(obj);
        }
Пример #3
0
        public void GivenMoodAnalyseClassName_ShouldReturnMoodAnalyseObject()
        {
            object expected = new MoodAnalyser();
            object obj      = MoodAnalyseFactory.CreateMoodAnalyserObject("MoodAnalyse.MoodAnalyser", "MoodAnalyser");

            expected.Equals(obj);
        }
Пример #4
0
        public void GivenMoodAnalyseClassName_ShouldReturnMoodAnalyseObject()
        {
            string message  = null;
            object expected = new MoodAnalyser(message);
            object obj      = MoodAnalyserFactory.CreateMoodAnalyser("MoodAnalyserAppWithCore.MoodAnalyser", "MoodAnalyser");

            expected.Equals(obj);
        }
Пример #5
0
        public void Given_MoodAnalyser_Class_Name_Should_Return_MoodAnalyser_Object_Using_Parametrized_Constructor()
        {
            //Arrange
            string       className       = "MoodAnalyse.MoodAnalyser";
            string       constructorName = "MoodAnalyser";
            MoodAnalyser expectedObj     = new MoodAnalyser("HAPPY");
            //Act
            object resultObj = MoodAnalyseFactory.CreateMoodAnalyserUsingParameterizedConstructor(className, constructorName, "HAPPY");

            //Assert
            expectedObj.Equals(resultObj);
        }
Пример #6
0
        public void Given_MoodAnalyser_Class_Name_Should_Return_MoodAnalyser_Object()
        {
            //Arrange
            string className       = "MoodAnalyse.MoodAnalyser";
            string constructorName = "MoodAnalyser";
            //Act
            object expected  = new MoodAnalyser();
            object resultObj = MoodAnalyseFactory.CreateMoodAnalyserObject(className, constructorName);

            //Assert
            expected.Equals(resultObj);
        }
Пример #7
0
        public void MoodAnalyseClass_GivenWrongClassName_ShouldReturn_NoClassException_UsingParameterizedConstrucor()
        {
            string expected = "Class not found";

            try
            {
                string message        = "Happy";
                string wrongClassName = "MoodAnalyserProblem2.MoodAnalyzer";
                object moodAnalyser   = new MoodAnalyser(message);
                object obj            = MoodAnalyzerFactory.CreateMoodAnalyserUsingParameterisedConstructors(wrongClassName, "MoodAnalyzer", message);
                moodAnalyser.Equals(obj);
            }
            catch (MoodAnalysisException e)
            {
                Assert.AreEqual(expected, e.Message);
            }
        }