Ejemplo n.º 1
0
 public void NPCBaseUndoChangeAndRedo()
 {
     CustomerINotifyPC obj = new CustomerINotifyPC();
     UndoRedoINPC sut = new UndoRedoINPC(obj);
     obj.Name = "one";
     obj.Name = "two";
     obj.Name = "three";
     sut.Undo();
     Assert.That(obj.Name, Is.EqualTo("two"));
     sut.Undo();
     Assert.That(obj.Name, Is.EqualTo("one"));
     obj.Name = "four";
     sut.Undo();
     Assert.That(obj.Name, Is.EqualTo("one"));
     sut.Redo();
     Assert.That(obj.Name, Is.EqualTo("four"));
 }
Ejemplo n.º 2
0
 public void NPCBaseUndo()
 {
     CustomerINotifyPC obj = new CustomerINotifyPC();
     UndoRedoINPC sut = new UndoRedoINPC(obj);
     obj.Name = "NewValue";
     sut.Undo();
     Assert.That(obj.Name, Is.Null);
 }
Ejemplo n.º 3
0
 public void NPCBaseRedoCountLimitExceeded()
 {
     CustomerINotifyPC obj = new CustomerINotifyPC();
     UndoRedoINPC sut = new UndoRedoINPC(obj);
     obj.Name = "one";
     sut.Undo();
     Assert.That(obj.Name, Is.Null);
     sut.Redo();
     Assert.That(obj.Name, Is.EqualTo("one"));
     sut.Redo();
     Assert.That(obj.Name, Is.EqualTo("one"));
 }
Ejemplo n.º 4
0
 public void NPCBaseUndoTwoLevelAndRedo()
 {
     CustomerINotifyPC obj = new CustomerINotifyPC();
     UndoRedoINPC sut = new UndoRedoINPC(obj);
     obj.Name = "one";
     obj.Name = "two";
     sut.Undo();
     Assert.That(obj.Name, Is.EqualTo("one"));
     sut.Undo();
     Assert.That(obj.Name, Is.Null);
     sut.Redo();
     Assert.That(obj.Name, Is.EqualTo("one"));
     sut.Redo();
     Assert.That(obj.Name, Is.EqualTo("two"));
 }