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 Transaction StartTransaction(int clientId, string description) { lock (myLock) { _undoStackManager.CreateStackForClient(clientId); return(_transactionService.StartTransaction(clientId, description)); } }
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); }