public void StartTransaction_Not_EndTransaction() { var clientId = 101; _undoStackManager.CreateStackForClient(clientId); var undoStack = _undoStackManager.GetStackOfClient(clientId); _transactionService.StartTransaction(clientId); _transactionService.Add( new Change(ChangeReason.InsertAt, 1, new TestObject()) , clientId); Assert.AreEqual(0, undoStack.UndoStackCount); }
public void No_EndTransaction_EventsRaisedTest() { var clientId = 101; _undoStackManager.CreateStackForClient(clientId); var undoStack = _undoStackManager.GetStackOfClient(clientId); int eventsRaised = 0; undoStack.ActiveStateChanged += (sender, changeSet) => { eventsRaised++; }; _transactionService.StartTransaction(clientId); _transactionService.Add( new Change(ChangeReason.InsertAt, 1, new TestObject()) , clientId); Assert.AreEqual(0, eventsRaised); }
public bool CanUndo(int clientId) { return(_undoStackManager.GetStackOfClient(clientId).CanUndo); }