public void ShouldNotCallExecuteCommandIfCommandWasExecuted()
        {
            var command = new TestableUndoableCommand();

            Assert.IsFalse(command.ExecuteCommandCalled);

            command.Execute();

            Assert.IsTrue(command.ExecuteCommandCalled);

            command.ExecuteCommandCalled = false;

            command.Execute();

            Assert.IsFalse(command.ExecuteCommandCalled);
        }
        public void ShouldMarkCommandAsExecutedWhenExecuting()
        {
            var command = new TestableUndoableCommand();

            Assert.IsFalse(command.WasExecuted);

            command.Execute();

            Assert.IsTrue(command.WasExecuted);
        }
        public void ShouldCallExecuteCommandWhenExecuting()
        {
            var command = new TestableUndoableCommand();

            Assert.IsFalse(command.ExecuteCommandCalled);

            command.Execute();

            Assert.IsTrue(command.ExecuteCommandCalled);
        }
Ejemplo n.º 4
0
        public void ShouldNotExecuteCommandIfWasAlreadyExecuted()
        {
            ICaretaker caretaker = new Caretaker(this.eventAggregator);

            var command = new TestableUndoableCommand();

            command.Execute();

            command.ExecuteCommandCalled = false;

            caretaker.ExecuteCommand(command);

            Assert.IsFalse(command.ExecuteCommandCalled);
        }