public void RegisterAction(Action action) { Argument.IsNotNull("action", action); lock (_lock) { _actions.Add(action); Log.Debug("Registered action in CompositeCommand"); } }
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); }