예제 #1
0
 public void Test_CancelEdit_ShouldFirePropertyUpdatedEvent()
 {
     //---------------Set up test pack-------------------
     Engine engine1 = new Engine();
     bool propertyEventFired = false;
     IBusinessObject eventBusinessObject = null;
     IBOProp eventProp = null;
     engine1.EngineNo = "20";
     engine1.PropertyUpdated +=
         delegate(object sender, BOPropUpdatedEventArgs eventArgs)
         {
             eventBusinessObject = eventArgs.BusinessObject;
             eventProp = eventArgs.Prop;
             propertyEventFired = true;
         };
     //-------------Assert Preconditions -------------
     Assert.IsFalse(propertyEventFired);
     Assert.IsNull(eventBusinessObject);
     Assert.IsNull(eventProp);
     //---------------Execute Test ----------------------
     engine1.CancelEdits();
     //---------------Test Result -----------------------
     Assert.IsTrue(propertyEventFired);
     Assert.AreSame(engine1, eventBusinessObject);
 }