public void TestDoAndSave()
 {
     var stack = new TransactionStack(5);
     using (var manager = new DirtiableManager(stack))
     {
         var dirtiable = new SimpleDirtiable();
         var operation = new SimpleDirtyingOperation(dirtiable.Yield());
         using (stack.CreateTransaction())
         {
             stack.PushOperation(operation);
         }
         Assert.AreEqual(true, dirtiable.IsDirty);
         manager.CreateSnapshot();
         Assert.AreEqual(false, dirtiable.IsDirty);
     }
 }
Beispiel #2
0
 public UndoRedoService(int stackCapacity)
 {
     stack = TransactionStackFactory.Create(stackCapacity);
     dirtiableManager = new DirtiableManager(stack);
 }