예제 #1
0
        public void TestUndoRedo()
        {
            document.SendCommand(new TestCommand());
            Assert.IsTrue(document.commandExecuted);
            Assert.IsTrue(document.CanUndo());
            Assert.IsFalse(document.CanRedo());

            document.Undo();
            Assert.IsTrue(document.commandUndone);
            Assert.IsFalse(document.commandExecuted);
            Assert.IsTrue(document.CanRedo());

            document.Redo();
            Assert.IsTrue(document.commandExecuted);
            Assert.IsTrue(document.CanUndo());
            Assert.IsFalse(document.CanRedo());
        }