public void givenMessageInConstructor_WhenContainsSad_ShouldReturnSad()
        {
            MoodAnalyzer moodAnalyzer = new MoodAnalyzer("I am in sad mood");
            string       mood         = moodAnalyzer.AnalyzeMood();

            Assert.AreEqual("sad", mood);
        }
Beispiel #2
0
        public void Given_MoodAnalyzerClassName_ShouldReturn_MoodAnalyzerObject()
        {
            object expected = new MoodAnalyzer();
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyse("MoodAnalyzerProject.MoodAnalyzer", "MoodAnalyzer");

            expected.Equals(obj);
        }
        public void GivenMoodAnalyzer_WhenClassName_ShouldReturnMoodAnalyzerObjectUsingParameterizedConstructor()
        {
            object expected = new MoodAnalyzer("Happy");
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyzerUsingParameterizedConstructor("MoodAnalyzerProblem.MoodAnalyzer", "MoodAnalyzer", "Happy");

            expected.Equals(obj);
        }
        public void givenMessage_WhenContainsAnyMood_ShouldReturnHappy()
        {
            MoodAnalyzer moodAnalyzer = new MoodAnalyzer();
            string       mood         = moodAnalyzer.AnalyzeMood("I am in any mood");

            Assert.AreEqual("happy", mood);
        }
Beispiel #5
0
        public void GivenHappyOrSadMoodShouldReturnHappyOrSad(string message, string expected)
        {
            moodAnalyzer = new MoodAnalyzer(message);
            string result = moodAnalyzer.analyseMood();

            Assert.AreEqual(result, expected);
        }
        /// Proper className
        public void RefactorTC4_1_ClassNameReturnsObject()
        {
            object expected = new MoodAnalyzer();
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyseWithoutAssembly("ExceptionHandling.MoodAnalyzer", "MoodAnalyzer");

            expected.Equals(obj);
        }
Beispiel #7
0
        public void Given_MoodAnalyser_ClassName_ShouldReturn_MoodAnalyseObject()
        {
            object expected = new MoodAnalyzer("NULL");
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyseMethod("MoodAnalyzer.MoodAnalyser", "MoodAnalyser");

            expected.Equals(obj);
        }
Beispiel #8
0
        public void Given_ProperMessage_To_MoodAnalyse_ShouldReturn_MoodAnalyseObject()
        {
            object expected = new MoodAnalyzer("HAPPY");
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyseUsingParameterizedConstructor("MoodAnalyzerProject.MoodAnalyzer", "MoodAnalyzer", "I am in Happy Mood");

            expected.Equals(obj);
        }
        public void givenMessageInConstructor_WhenContainsHappy_ShouldReturnHappy()
        {
            MoodAnalyzer moodAnalyzer = new MoodAnalyzer("I am in happy mood");
            string       mood         = moodAnalyzer.AnalyzeMood();

            Assert.AreEqual("happy", mood);
        }
Beispiel #10
0
        public void TestMethod8()
        {
            string message  = "HAPPY";
            object expected = new MoodAnalyzer(message);
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyseUsingParameter("ExceptionHandling.MoodAnalyzer", "MoodAnalyzer", "HAPPY");

            expected.GetType().Equals(obj.GetType());
        }
Beispiel #11
0
        public void TestMethod5()
        {
            string message  = null;
            object expected = new MoodAnalyzer(message);
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyse("ExceptionHandling.MoodAnalyzer", "MoodAnalyzer");

            expected.Equals(obj);
        }
Beispiel #12
0
        public void GivenMoodAnalyzerClassNameShouldReturnMoodAnalyzerObject()
        {
            string message  = null;
            object expected = new MoodAnalyzer(message);
            object obj      = MoodAnalyzerFactory.createMoodAnalyzer("MoodAnalyzerAppWithCore.MoodAnalyzer", "MoodAnalyzer");

            expected.Equals(obj);
        }
Beispiel #13
0
        public void InvokeAnalyseMoodUsingReflection()
        {
            MoodAnalyzer instance = new MoodAnalyzer("I am Sad");
            string       expected = instance.analyseMood();
            string       result   = MoodAnalyzerFactory.invokeAnalyseMood("I am Sad", "analyseMood");

            Assert.AreEqual(result, expected);
        }
        public void GivenMoodAnalyzer_WhenClassName_ShouldReturnMoodAnalyzerObject()
        {
            string message  = null;
            object expected = new MoodAnalyzer(message);
            object obj      = MoodAnalyzerFactory.CreateMoodAnalyzer("MoodAnalyzerProblem.MoodAnalyzer", "MoodAnalyzer");

            expected.Equals(obj);
        }
Beispiel #15
0
        public void GivenMoodAnalyseClass_ShouldReturn_MoodAnalyserObject()
        {
            string message              = null;
            object expected             = new MoodAnalyzer(message);
            MoodAnalyserFactory factory = new MoodAnalyserFactory();
            object obj = factory.CreateMoodAnalyzerObject("MoodAnalyzerProblem.MoodAnalyzer", "MoodAnalyzer");

            expected.Equals(obj);
        }
Beispiel #16
0
        public void Given_Nullmood_Expecting_happy_Result() //Method
        {
            MoodAnalyzer mood     = new MoodAnalyzer(null); //Create object and arrange
            string       expected = "happy";

            string actual = mood.Analyzer();    //act

            Assert.AreEqual(expected, actual);  //Assert
        }
Beispiel #17
0
        public void Given_Nullmood_Expecting_Exception_Result() //Method
        {
            MoodAnalyzer mood     = new MoodAnalyzer(null);     //Create object and arrange
            string       expected = "Object reference not set to an instance of an object.";

            string actual = mood.Analyzer();    //act

            Assert.AreEqual(expected, actual);  //Assert
        }
        public void GivenMood_WhenNull_ThenShouldReturnHappyMood(string message)
        {
            string Expected = "Happy";

            moodAnalyzer = new MoodAnalyzer(message);
            string mood = moodAnalyzer.analyseMood();

            Assert.AreEqual(Expected, mood);
        }
Beispiel #19
0
        public void Given_I_am_sad_When_AnalyseMood_Sould_return_Sad()
        {
            string       message      = "I am in a sad mood";
            MoodAnalyzer moodAnalyser = new MoodAnalyzer(message);

            string result = moodAnalyser.AnalyseMood();

            Assert.AreEqual("SAD", result);
        }
        public void GivenMood_WhenHappy_ThenShouldReturnHappyMood()
        {
            string Expected = "Happy";

            moodAnalyzer = new MoodAnalyzer("I am in happy Mood");
            string mood = moodAnalyzer.analyseMood();

            Assert.AreEqual(Expected, mood);
        }
Beispiel #21
0
        public void Given_I_am_happy_When_AnalyseMood_Sould_return_Happy()
        {
            string       message      = "I am in a happy mood";
            MoodAnalyzer moodAnalyser = new MoodAnalyzer(message);

            string result = moodAnalyser.AnalyseMood();

            Assert.AreEqual("HAPPY", result);
        }
        /// Proper ClassName Returns object
        public void TC5_1ReturnObject()
        {
            //Arrange
            object expected = new MoodAnalyzer();
            //Act
            object obj = MoodAnalyzerFactory.CreateMoodAnalyseWithParameter("ExceptionHandling.MoodAnalyzer", "MoodAnalyzer", "I am in happy mood today");

            //Assert
            expected.GetType().Equals(obj.GetType());
        }
        public void TC6_1_HappyReturnsHappy()
        {
            //Arrange
            MoodAnalyzer moodAnalyser = new MoodAnalyzer("I am in happy mood today");
            //Act
            string actual = MoodAnalyzerReflector.InvokeAnalyseMood("ExceptionHandling.MoodAnalyzer", "MoodAnalyzer", "I am in happy mood today", "AnalyseMood");

            //Assert
            Assert.AreEqual("HAPPY", actual);
        }
Beispiel #24
0
        public void checkForHappy()
        {
            //create object of moodanalyzer constructor
            obj = new MoodAnalyzer("i am in any mood");
            //massage does not contain sad then analyseTheMood return happy
            string mood = obj.analyseTheMood();

            //if string and mood is same test case pass
            Assert.AreEqual("happy", mood);
        }
Beispiel #25
0
        public void GivenClassName_CreateDefaultObjectUsingReflection(string className, string constructorName)
        {
            //Arrange
            //Act
            object expected = new MoodAnalyzer();
            object actual   = MoodAnalyzerReflection.CreateMoodAnalyzerObject(className, constructorName);

            //Assert
            Assert.AreEqual(expected.GetType(), actual.GetType()); // To check if both objects are of same type
        }
Beispiel #26
0
        public void Given_I_Am_In_Sad_Mood_Should_Return_SAD()
        {
            //Arrange
            string       message      = "I am in sad mood.";
            MoodAnalyzer moodAnalyser = new MoodAnalyzer(message);
            //Act
            string result = moodAnalyser.AnalyseMood();

            //Assert
            Assert.AreEqual("SAD", result);
        }
Beispiel #27
0
        public void Given_I_Am_In_Happy_Mood_Should_Return_HAPPY()
        {
            //Arrange
            string       message      = "I am in happy mood.";
            MoodAnalyzer moodAnalyser = new MoodAnalyzer(message);
            //Act
            string result = moodAnalyser.AnalyseMood();

            //Assert
            Assert.AreEqual("HAPPY", result);
        }
Beispiel #28
0
        public void AnalyseMood_ShouldReturn_Sad()
        {
            //Arraneg
            string       expected = "sad";
            MoodAnalyzer obj      = new MoodAnalyzer("I am in sad Mood");
            //Act
            string actual = obj.Analyzer();

            //Assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #29
0
        public void Given_Happymood_Expecting_Happy_Result()
        {
            //Arrange
            MoodAnalyzer mood     = new MoodAnalyzer("I am in happy mood"); //create object
            string       expected = "happy";
            //Act
            string actual = mood.Analyzer();

            //Assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #30
0
        public void Given_Nullmood_Expecting_happy_Result()
        {
            //Arrange
            MoodAnalyzer mood     = new MoodAnalyzer(null); //Create object
            string       expected = "happy";
            //Act
            string actual = mood.Analyzer();

            //Assert
            Assert.AreEqual(expected, actual);
        }