public Folder GoForward() { var folder = History.GoForward(); CurrentPath = folder.Path; return(folder); }
public void TestRedoNormal() { var hk = new HistoryKeeper <int>(0); hk.Do(4); hk.GoBack(); Assert.AreEqual(4, hk.GoForward()); hk.Do(1); hk.Do(2); hk.Do(3); hk.GoBack(); hk.GoBack(); Assert.AreEqual(2, hk.GoForward()); Assert.AreEqual(3, hk.GoForward()); hk.GoBack(); Assert.AreEqual(3, hk.GoForward()); }
public void TestRedoClearsOnDo() { var hk = new HistoryKeeper <int>(0); hk.Do(4); hk.Do(4); hk.GoBack(); hk.Do(5); Assert.Throws <EmptyHistoryException>(() => hk.GoForward()); }
public void TestRedoThrowsExcpOnEmpty() { var hk = new HistoryKeeper <int>(0); Assert.Throws <EmptyHistoryException>(() => hk.GoForward()); hk.Do(4); Assert.Throws <EmptyHistoryException>(() => hk.GoForward()); hk.GoBack(); hk.GoForward(); Assert.Throws <EmptyHistoryException>(() => hk.GoForward()); hk.Do(1); hk.Do(2); hk.Do(3); hk.GoBack(); hk.GoBack(); Assert.AreEqual(2, hk.GoForward()); Assert.AreEqual(3, hk.GoForward()); hk.GoBack(); Assert.AreEqual(3, hk.GoForward()); }