Catel.Test.MVVM.CompositeCommandFacts.TheCanExecuteState.PreventsExecutionOfPartiallyExecutableCommand C# (CSharp) Метод

PreventsExecutionOfPartiallyExecutableCommand() приватный Метод

private PreventsExecutionOfPartiallyExecutableCommand ( bool checkCanExecuteOfAllCommandsToDetermineCanExecuteForCompositeCommand, bool expectedValue ) : void
checkCanExecuteOfAllCommandsToDetermineCanExecuteForCompositeCommand bool
expectedValue bool
Результат 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));
            }
        }