public void ThrowExceptionIfChangeCompletedDuringUndo() { ChangeHistory <FakeChangeToken> history = null; history = new ChangeHistory <FakeChangeToken>(token => { history.CurrentChange.ToString(); history.ChangeCompleted(); return(new FakeChangeToken()); }); history.CurrentChange.ToString(); // create current change Assert.Throws <InvalidOperationException>(() => history.Undo.Execute()); }
public void ClosingEmptyChangeDoesNotAddUndoItem() { history.ChangeCompleted(); Assert.False(history.Undo.CanExecute(null)); }