Catel.Test.MVVM.CompositeCommandFacts.TheCanExecuteState.PreventsExecutionOfPartiallyExecutableCommand C# (CSharp) Method

PreventsExecutionOfPartiallyExecutableCommand() private method

private PreventsExecutionOfPartiallyExecutableCommand ( bool checkCanExecuteOfAllCommandsToDetermineCanExecuteForCompositeCommand, bool expectedValue ) : void
checkCanExecuteOfAllCommandsToDetermineCanExecuteForCompositeCommand bool
expectedValue bool
return void
            public void PreventsExecutionOfPartiallyExecutableCommand(bool checkCanExecuteOfAllCommandsToDetermineCanExecuteForCompositeCommand, bool expectedValue)
            {
                var compositeCommand = new CompositeCommand();

                compositeCommand.RegisterCommand(new Command(() => { }, () => false));
                compositeCommand.RegisterCommand(new Command(() => { }, () => true));

                compositeCommand.CheckCanExecuteOfAllCommandsToDetermineCanExecuteForCompositeCommand = checkCanExecuteOfAllCommandsToDetermineCanExecuteForCompositeCommand;

                Assert.AreEqual(expectedValue, ((ICatelCommand)compositeCommand).CanExecute(null));
            }
        }