RegisterAction() public method

Registers the specified action.
The is null.
public RegisterAction ( System.Action action ) : void
action System.Action The action.
return void
            public void RegistersActionForExecution()
            {
                var compositeCommand = new CompositeCommand();

                bool executed = false;
                var action = new Action<object>(obj => executed = true);

                compositeCommand.RegisterAction(action);
                compositeCommand.Execute();

                Assert.IsTrue(executed);
            }
            public void RegisteredActionsCanBeUnregistered_DynamicAction()
            {
                var compositeCommand = new CompositeCommand();

                compositeCommand.RegisterAction(RegisteredActionsCanBeUnregistered_TestMethod);
                compositeCommand.UnregisterAction(RegisteredActionsCanBeUnregistered_TestMethod);

                compositeCommand.Execute(null);

                Assert.IsFalse(_registeredActionsCanBeUnregistered_TestValue);
            }
            public void ThrowsArgumentNullExceptionForNullAction()
            {
                var compositeCommand = new CompositeCommand();

                ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => compositeCommand.RegisterAction((Action<object>)null));
            }
            public void RegisteredActionsCanBeUnregistered_DefinedAction()
            {
                var invoked = false;
                Action action = () => invoked = true;

                var compositeCommand = new CompositeCommand();

                compositeCommand.RegisterAction(action);
                compositeCommand.UnregisterAction(action);

                compositeCommand.Execute(null);

                Assert.IsFalse(invoked);
            }