/// <summary> /// Adds the command to commands undo/redo list. /// </summary> /// <param name="command">The command.</param> private void AddCommand(ICommand command) { if (command != null) { command.Execute(); commandsList.Add(command); } SetBtnState(); }
public void TestAdd() { commandsList.Add(command1); Assert.IsTrue(commandsList.CanUndo); Assert.IsFalse(commandsList.CanRedo); Assert.AreEqual(commandsList.UndoMsg, UNDO_STRING + COMMAND_NAME1); }