Пример #1
0
 public void TestDoAction()
 {
     var actionStack = new TransactionalActionStack(5);
     using (new DirtiableManager(actionStack))
     {
         var dirtiable = new SimpleDirtiable();
         var action = new SimpleDirtiableActionItem(dirtiable.Yield());
         actionStack.Add(action);
         Assert.AreEqual(true, dirtiable.IsDirty);
     }
 }
Пример #2
0
 public void TestDoAndSave()
 {
     var actionStack = new TransactionalActionStack(5);
     using (var manager = new DirtiableManager(actionStack))
     {
         var dirtiable = new SimpleDirtiable();
         var action = new SimpleDirtiableActionItem(dirtiable.Yield());
         actionStack.Add(action);
         Assert.AreEqual(true, dirtiable.IsDirty);
         actionStack.CreateSavePoint(true);
         manager.NotifySave();
         Assert.AreEqual(false, dirtiable.IsDirty);
     }
 }