示例#1
0
 public void SetNullField_throwException()
 {
     try
     {
         analyseMoodFactory <analyseMood3> mood = new analyseMoodFactory <analyseMood3>();
         Assert.AreEqual("Null_Exception", mood.InvokeMethodUsing("analyseMood3", null));
     }
     catch (NullReferenceException e)
     {
         _ = e.StackTrace;
     }
 }
示例#2
0
 public void SetImproperField_throwException()
 {
     try
     {
         analyseMoodFactory <analyseMood3> mood = new analyseMoodFactory <analyseMood3>();
         string actual   = mood.InvokeMethodUsing("analyseMood3", "inproper field name");
         string Expected = "No_Such_Field_Exception";
         Assert.AreEqual(Expected, actual);
     }
     catch (NullReferenceException e)
     {
         _ = e.StackTrace;
     }
 }
示例#3
0
 public void SetFieldValue_shouldReturnHappy()
 {
     try
     {
         analyseMoodFactory <analyseMood3> mood = new analyseMoodFactory <analyseMood3>();
         string actual   = mood.InvokeMethodUsing("analyseMood3", "message");
         string Expected = "HAPPY";
         Assert.AreEqual(Expected, actual);
     }
     catch (NullReferenceException e)
     {
         _ = e.StackTrace;
     }
 }