public void TestUndoRedoTwoTimes() { Action undo = mockRepo.CreateMock<Action>(); Action redo = mockRepo.CreateMock<Action>(); Expect.Call(() => undo()).Repeat.Twice(); Expect.Call(() => redo()).Repeat.Twice(); mockRepo.ReplayAll(); UndoRedoList sut = new UndoRedoList(); sut.Add(undo, redo); sut.Undo(); sut.Redo(); sut.Undo(); sut.Redo(); }
public void TestUndoRedoTwoTimesIsUndoableRedoable() { UndoRedoList sut = new UndoRedoList(); sut.Add(NoAction, NoAction); Assert.That(sut.IsUndoActive); Assert.That(sut.UndoCount, Is.EqualTo(1)); sut.Undo(); Assert.That(sut.IsUndoActive, Is.False); Assert.That(sut.UndoCount, Is.EqualTo(0)); Assert.That(sut.IsRedoActive); Assert.That(sut.RedoCount, Is.EqualTo(1)); sut.Redo(); Assert.That(sut.IsUndoActive); Assert.That(sut.UndoCount, Is.EqualTo(1)); Assert.That(sut.IsRedoActive, Is.False); Assert.That(sut.RedoCount, Is.EqualTo(0)); }
public void TestRedoListCount() { UndoRedoList sut = new UndoRedoList(); sut.Add(NoAction, NoAction); sut.Add(NoAction, NoAction); sut.Add(NoAction, NoAction); sut.Undo(); sut.Undo(); Assert.That(sut.RedoCount, Is.EqualTo(2)); }
public void TestUndoable() { UndoRedoList sut = new UndoRedoList(); sut.Add(NoAction, null); Assert.That(sut.IsUndoActive); }
public void TestRedoableWhenUndo() { UndoRedoList sut = new UndoRedoList(); sut.Add(NoAction, NoAction); sut.Undo(); Assert.That(sut.IsRedoActive, Is.True); }
public void TestRedoable() { UndoRedoList sut = new UndoRedoList(); sut.Add(NoAction, NoAction); Assert.That(sut.IsRedoActive, Is.False); }
public void TestNameList() { UndoRedoList sut = new UndoRedoList(); sut.Add("ActionName", NoAction, NoAction); Assert.That(sut.ActionList.Count(), Is.EqualTo(1)); Assert.That(sut.ActionList.First(), Is.EqualTo("ActionName")); }
public void TestBasicUndo() { Action act = mockRepo.CreateMock<Action>(); act(); mockRepo.ReplayAll(); UndoRedoList sut = new UndoRedoList(); sut.Add(act, null); sut.Undo(); }
public void TestBasicListAction() { UndoRedoList sut = new UndoRedoList(); sut.Add(null, null); Assert.That(sut.UndoCount, Is.EqualTo(1)); }