Beispiel #1
0
 public void Test_PropValueEquals_WhenBothNull_ShouldRetTrue()
 {
     //---------------Set up test pack-------------------
     int? x = null;
     int? y = null;
     BOPropSpy prop = new BOPropSpy { Value = x };
     //---------------Assert Precondition----------------
     Assert.AreEqual(x, y);
     Assert.AreEqual(prop.Value, y);
     //---------------Execute Test ----------------------
     bool currentValueEquals = prop.CurrentValueEquals(y);
     //---------------Test Result -----------------------
     Assert.IsTrue(currentValueEquals);
 }
Beispiel #2
0
 public void Test_CurrentValueEquals(object x, object y, bool areEqual, string message)
 {
     //---------------Set up test pack-------------------
     IBOProp prop = new BOPropSpy { Value = x };
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     bool currentValueEquals = prop.CurrentValueEquals(y);
     //---------------Test Result -----------------------
     string expectedMessage 
         = string.Format("x : '{0}' - y : '{1}' CurrentValueEquals Should be : {2}"
             , x, y, areEqual) + Environment.NewLine + message;
     Assert.AreEqual(areEqual, currentValueEquals, expectedMessage);
 }
Beispiel #3
0
 public void Test_PropValueEquals_WhenSame_ShouldRetTrue()
 {
     //---------------Set up test pack-------------------
     object x = 1;
     object y = x;
     BOProp prop = new BOPropSpy {Value = x};
     //---------------Assert Precondition----------------
     Assert.AreSame(x, y);
     Assert.AreSame(prop.Value, y);
     //---------------Execute Test ----------------------
     bool currentValueEquals = prop.CurrentValueEquals(y);
     //---------------Test Result -----------------------
     Assert.IsTrue(currentValueEquals);
 }