public void UndoTransactionCompleted_EmptyRedo() { Create(); _operationsRaw._redoStack = (new[] { UndoRedoData.NewLinked(10) }).ToFSharpList(); _history.Raise(x => x.UndoTransactionCompleted += null, new TextUndoTransactionCompletedEventArgs(null, TextUndoTransactionCompletionResult.TransactionAdded)); Assert.AreEqual(0, _operationsRaw._redoStack.Length); }
public void Undo_StackWithLinked() { Create(); _operationsRaw._undoStack = (new[] { UndoRedoData.NewLinked(10) }).ToFSharpList(); _history.Setup(x => x.Undo(10)).Verifiable(); _operationsRaw.Undo(1); _factory.Verify(); Assert.AreEqual(0, _operationsRaw._undoStack.Length); }
public void Undo_WithLinkedTransactionOpen() { Create(); _operations.CreateLinkedUndoTransaction(); _operationsRaw._undoStack = (new[] { UndoRedoData.NewLinked(10) }).ToFSharpList(); _textUndoHistory.Setup(x => x.Undo(1)).Verifiable(); _statusUtil.Setup(x => x.OnError(Resources.Common_UndoChainBroken)).Verifiable(); _operations.Undo(1); _factory.Verify(); Assert.AreEqual(0, _operationsRaw._undoStack.Length); Assert.IsFalse(_operations.InLinkedUndoTransaction); }