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 }
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 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); }
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); }
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); }
public void Given_Nullmood_Expecting_Exception_Result() { //Arrange MoodAnalyzer mood = new MoodAnalyzer(null); string expected = "Object reference not set to an instance of an object."; //Act string actual = mood.Analyzer(); //Assert Assert.AreEqual(expected, actual); }
public void Given_Emptymood_Using_CustomExpection_Return_Empty() //Method { string actual = ""; try { string message = string.Empty; MoodAnalyzer mood = new MoodAnalyzer(message); //Create object and arrange actual = mood.Analyzer(); //act } catch (MoodAnalyserException exception) { Assert.AreEqual("Mood should not be empty", exception.Message); //Assert } }
public void Given_Nullmood_Using_CustomExpection_Return_Null() //Method { MoodAnalyzer mood = new MoodAnalyzer(null); //Create object and arrange //string actual = ""; string actual = ""; try { actual = mood.Analyzer(); //act } catch (MoodAnalyserException exception) { Assert.AreEqual("Mood should not be null", exception.Message); //Assert } }
public void Given_Nullmood_Using_CustomExpection_Return_Null() { //Arrange MoodAnalyzer mood = new MoodAnalyzer(null); //Create object string actual = ""; try { //Act actual = mood.Analyzer(); } catch (Exception ex) { //Assert Assert.AreEqual("Mood should not be null", ex.Message); } }
public void GivenMood_IfEmpty_ShouldThrowException() { string actual = ""; try { //Arrange string message = string.Empty; MoodAnalyzer mood = new MoodAnalyzer(message); //Create object //Act actual = mood.Analyzer(); } catch (Exception ex) { //Assert Assert.AreEqual("Mood should not be empty", ex.Message); } }