예제 #1
0
        public void NPCBaseRedoActionName()
        {
            CustomerINotifyPC obj = new CustomerINotifyPC();
            UndoRedoINPC      sut = new UndoRedoINPC(obj);

            obj.Name = "NewValue";
            Assert.That(sut.ActionList.First(), Is.EqualTo("Property Name changed from [] to [NewValue]"));
        }
예제 #2
0
        public void NPCBaseRedo()
        {
            CustomerINotifyPC obj = new CustomerINotifyPC();
            UndoRedoINPC      sut = new UndoRedoINPC(obj);

            obj.Name = "NewValue";
            Assert.That(sut.UndoCount, Is.EqualTo(1));
        }
예제 #3
0
        public void NPCBaseUndo()
        {
            CustomerINotifyPC obj = new CustomerINotifyPC();
            UndoRedoINPC      sut = new UndoRedoINPC(obj);

            obj.Name = "NewValue";
            sut.Undo();
            Assert.That(obj.Name, Is.Null);
        }
예제 #4
0
        public void NPCBaseUndoCountLimitExceeded()
        {
            CustomerINotifyPC obj = new CustomerINotifyPC();
            UndoRedoINPC      sut = new UndoRedoINPC(obj);

            obj.Name = "one";
            sut.Undo();
            Assert.That(obj.Name, Is.Null);
            sut.Undo();
        }
예제 #5
0
        public void NPCBaseUndoTwoLevel()
        {
            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);
        }
예제 #6
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"));
        }