public UnregisterAction ( string commandName, System.Action action ) : void | ||
commandName | string | Name of the command. |
action | System.Action | The action. |
return | void |
public void RegisteredActionsCanBeUnregistered_DynamicAction() { var commandManager = new CommandManager(); commandManager.CreateCommand("TestAction"); commandManager.RegisterAction("TestAction", RegisteredActionsCanBeUnregistered_TestMethod); commandManager.UnregisterAction("TestAction", RegisteredActionsCanBeUnregistered_TestMethod); commandManager.ExecuteCommand("TestAction"); Assert.IsFalse(_registeredActionsCanBeUnregistered_TestValue); }
public void RegisteredActionsCanBeUnregistered_DefinedAction() { var invoked = false; Action action = () => invoked = true; var commandManager = new CommandManager(); commandManager.CreateCommand("TestAction"); commandManager.RegisterAction("TestAction", action); commandManager.UnregisterAction("TestAction", action); commandManager.ExecuteCommand("TestAction"); Assert.IsFalse(invoked); }