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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public bool CanUndo(int clientId)
 {
     return(_undoStackManager.GetStackOfClient(clientId).CanUndo);
 }