示例#1
0
        public void Push_InMiddleOfStack_RemovesLaterReversibles()
        {
            var reversibles = new ReversibleStack();
            var value       = new Value();

            reversibles.Push(new Add1(value));
            reversibles.Push(new Add1(value));
            reversibles.Push(new Add1(value));
            reversibles.Undo();
            reversibles.Undo();
            reversibles.Push(new Add1(value));
            reversibles.Redo();
            reversibles.Redo();
            Assert.AreEqual(2, value.Number);
        }
示例#2
0
        public void PushUndoRedo_Is1()
        {
            var reversibles = new ReversibleStack();
            var value       = new Value();

            reversibles.Push(new Add1(value));
            reversibles.Undo();
            reversibles.Redo();
            Assert.AreEqual(1, value.Number);
        }
示例#3
0
        public void Redo_AtZeroReversibles_DoesNothing()
        {
            var reversibles = new ReversibleStack();

            reversibles.Redo();
        }