コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: lakshmehta/Mood_Analyser
        public void GivenMoodAnalyseClassName_ShouldReturnMoodAnalyseObject_UsingParameterizedConstructor()
        {
            object expected = new MoodAnalyser("HAPPY");
            object obj      = MoodAnalyserFactory.CreateMoodAnalyseUsingParameterizedConstructor("MoodAnalyserAppWithCore.MoodAnalyser", "MoodAnalyser", "SAD");

            expected.Equals(obj);
        }
コード例 #2
0
        public void GivenMoodAnalyser_WhenAnalysed_UsingParameterizedConstructor_ShouldReturnMoodAnalyserObject()
        {
            object expected = new MoodAnalyser();
            object actual   = MoodAnalyserFactory.CreateObjectOfMoodAnalyserUsingParameterizedConstructor("MoodAnalyserApp.MoodAnalyser", "MoodAnalyser", "Happy");

            Assert.AreEqual(expected.GetType(), actual.GetType());
        }
コード例 #3
0
        public void GivenMoodAnalyserClassName_WhenAnalysed_ShouldReturn_MoodAnalyserObject()
        {
            object expected = new MoodAnalyser();
            object actual   = MoodAnalyserFactory.MoodAnalyseObjectCreation("MoodAnalyserApp.MoodAnalyser", "MoodAnalyser");

            Assert.AreEqual(expected.GetType(), actual.GetType());
        }
コード例 #4
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);
        }
コード例 #5
0
        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());
        }
コード例 #6
0
ファイル: UnitTest1.cs プロジェクト: Ajay4296/MoodAnalyser
        public void AnalyseMood_WhenSadReturnSad()
        {
            MoodAnalyser moodobj  = new MoodAnalyser("I am in sad mood");
            string       Expected = "SAD";

            Assert.AreEqual(Expected, moodobj.AnalyseMood());
        }
コード例 #7
0
ファイル: MSTest.cs プロジェクト: kalyangoud145/MoodAnalyse
        public void GivenMoodAnalyseClassName_ShouldReturnMoodAnalyseObject()
        {
            object expected = new MoodAnalyser();
            object obj      = MoodAnalyseFactory.CreateMoodAnalyserObject("MoodAnalyse.MoodAnalyser", "MoodAnalyser");

            expected.Equals(obj);
        }
コード例 #8
0
ファイル: UnitTest1.cs プロジェクト: Ajay4296/MoodAnalyser
        public void AnalyseMood_WhenHappyMoodReturnHappy()
        {
            MoodAnalyser moodobj  = new MoodAnalyser("I am in happy mood");
            string       Expected = "HAPPY";

            Assert.AreEqual(Expected, moodobj.AnalyseMood());
        }
コード例 #9
0
        static void Main(string[] args)
        {
            MoodAnalyser mood = new MoodAnalyser("sad");

            mood.analyseMoodLive1();
            Console.ReadKey();
        }
コード例 #10
0
        public void whenMood_IsSad_ShouldReturnSad()
        {
            MoodAnalyser moodAnalyser = new MoodAnalyser();
            string       mood         = moodAnalyser.analyseMood("I am in sad Mood");

            Assert.AreEqual("SAD", mood);
        }
コード例 #11
0
        public void whenMood_IsHappy_ShouldReturnHappy()
        {
            MoodAnalyser moodAnalyser = new MoodAnalyser();
            string       mood         = moodAnalyser.analyseMood("I am in happy Mood");

            Assert.AreEqual("HAPPY", mood);
        }
コード例 #12
0
        public void Given_MoodAnalyserClassName_Should_ReturnMoodAnalyserObject()
        {
            string message  = null;
            object expected = new MoodAnalyser(message);
            object actual   = MoodAnalyserFactory.MoodAnalyseObjectCreation("MoodAnalyserApp.MoodAnalyser", "MoodAnalyser");

            Assert.AreEqual(expected.GetType(), actual.GetType());
        }
コード例 #13
0
ファイル: UnitTest1.cs プロジェクト: lakshmehta/Mood_Analyser
        public void GivenMoodAnalyseClassName_ShouldReturnMoodAnalyseObject()
        {
            string message  = null;
            object expected = new MoodAnalyser(message);
            object obj      = MoodAnalyserFactory.CreateMoodAnalyser("MoodAnalyserAppWithCore.MoodAnalyser", "MoodAnalyser");

            expected.Equals(obj);
        }
コード例 #14
0
        public void Given_Happy_MoodAnalyser_Should_Return_Happy()
        {
            //Arrange
            MoodAnalyser moodAnalyse = new MoodAnalyser("I am in a Happy mood");
            //Act
            string mood = moodAnalyse.AnalyseMood();

            //Assert
            Assert.AreEqual("HAPPY", mood);
        }
コード例 #15
0
        public void Given_Sad_MoodAnalyser_Should_Return_Sad()
        {
            //Arrange
            MoodAnalyser moodAnalyse = new MoodAnalyser("I am in a Sad mood");
            //Act
            string mood = moodAnalyse.AnalyseMood();

            //Assert
            Assert.AreEqual("SAD", mood);
        }
コード例 #16
0
        public void GivenSadMessage_WhenAnalysed_ShouldReturnSadMood()
        {
            //Arrange
            MoodAnalyser analyser = new MoodAnalyser("I am in a Sad mood");
            //Act
            string mood = analyser.AnalyseMood();

            //Assert
            Assert.AreEqual("Sad", mood);
        }
コード例 #17
0
        public void GivenHappyMessage_WhenAnalysed_ShouldReturnHappyMood()
        {
            //Arrange
            MoodAnalyser analyser = new MoodAnalyser("I am in a Happy mood");
            //Act
            string mood = analyser.AnalyseMood();

            //Assert
            Assert.AreEqual("Happy", mood);
        }
コード例 #18
0
        public void GivenSadMessage_WhenSad_ShouldReturnSAD()
        {
            //Arrange
            string       Expected     = "SAD";
            MoodAnalyser moodAnalyser = new MoodAnalyser("I am in Sad Mood");
            //Act
            string result = moodAnalyser.AnalyseMood();

            //Assert
            Assert.AreEqual(Expected, result);
        }
コード例 #19
0
        public void GivenNULLMessage_WhenANULL_ShouldReturnHAPPY(string message)
        {
            //Arrange
            string       Expected     = "Happy";
            MoodAnalyser moodAnalyser = new MoodAnalyser(message);
            //Act
            string result = moodAnalyser.AnalyseMood();

            //Assert
            Assert.AreEqual(Expected, result);
        }
コード例 #20
0
ファイル: MSTest.cs プロジェクト: kalyangoud145/MoodAnalyse
        public void Given_HappyMoodMessage_Should_Return_HAPPY()
        {
            ///Arrange
            string       expected     = "HAPPY";
            MoodAnalyser moodAnalyser = new MoodAnalyser("i am very happy".ToUpper());
            ///Act
            string mood = moodAnalyser.AnalyseMood();

            ///Assert
            Assert.AreEqual(expected, mood);
        }
コード例 #21
0
ファイル: MSTest.cs プロジェクト: kalyangoud145/MoodAnalyse
        public void Given_SadMoodMessage_Should_Return_SAD()
        {
            ///Arrange
            string       expected     = "SAD";
            MoodAnalyser moodAnalyser = new MoodAnalyser("i am very sad".ToUpper());
            ///Act
            string mood = moodAnalyser.AnalyseMood();

            ///Assert
            Assert.AreEqual(expected, mood);
        }
コード例 #22
0
        public void GivenAnyMessage_WhenAnyMood_ShouldReturnHAPPY()
        {
            //Arrange
            string       Expected     = "HAPPY";
            MoodAnalyser moodAnalyser = new MoodAnalyser("I am in Any Mood");
            //Act
            string result = moodAnalyser.AnalyseMood();

            //Assert
            Assert.AreEqual(Expected, result);
        }
コード例 #23
0
ファイル: MSTest.cs プロジェクト: kalyangoud145/MoodAnalyse
        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);
        }
コード例 #24
0
 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);
     }
 }
コード例 #25
0
 public void GivenImproperConstructorName_WhenAnalyse_ShouldThrowMoodAnalysisException()
 {
     try
     {
         object expected = new MoodAnalyser();
         object actual   = MoodAnalyserFactory.MoodAnalyseObjectCreation("Mood", "MoodAnalyser");
     }
     catch (MoodAnalyserCustomException e)
     {
         Assert.AreEqual("Constructor not found", e.Message);
     }
 }
コード例 #26
0
 public void GivenImproperClassName_WhenAnalyse_ShouldThrowMoodAnalysisException()
 {
     try
     {
         object expected = new MoodAnalyser();
         object actual   = MoodAnalyserFactory.MoodAnalyseObjectCreation("abc", "abc");
     }
     catch (MoodAnalyserCustomException e)
     {
         Assert.AreEqual("No such class found", e.Message);
     }
 }
コード例 #27
0
 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);
     }
 }
コード例 #28
0
 public void GivenImproperConstructorName_WhenAnalyse_UsingParameterisedConstructor_ShouldThrowMoodAnalysisException()
 {
     try
     {
         object expected = new MoodAnalyser();
         object actual   = MoodAnalyserFactory.CreateObjectOfMoodAnalyserUsingParameterizedConstructor("MoodAnalyserApp.MoodAnalyser", "Mood", "Happy");
     }
     catch (MoodAnalyserCustomException e)
     {
         Assert.AreEqual("Constructor not found", e.Message);
     }
 }
コード例 #29
0
 public void Given_ImproperClassName_Should_Throw_MoodAnalysisException_NO_SUCH_CLASS()
 {
     try
     {
         object expected = new MoodAnalyser();
         object actual   = MoodAnalyserFactory.MoodAnalyseObjectCreation("WrongClass", "MoodAnalyser");
     }
     catch (MoodAnalyserCustomException e)
     {
         Assert.AreEqual("No such class found", e.Message);
     }
 }
コード例 #30
0
 public void Given_ImproperConstructorName_Should_Throw_MoodAnalysisException_NO_SUCH_METHOD()
 {
     try
     {
         object expected = new MoodAnalyser();
         object actual   = MoodAnalyserFactory.MoodAnalyseObjectCreation("WrongConstructor", "WrongConstructor");
     }
     catch (MoodAnalyserCustomException e)
     {
         Assert.AreEqual("No such Constructor found", e.Message);
     }
 }