private void Setup(bool withCanExecutePredicate = false, bool canExecuteResult = false)
        {
            Func <SourceObject, bool> canExecuteFunction = null;

            if (withCanExecutePredicate)
            {
                canExecuteFunction = (so) => {
                    LastCanExecuteInvocation = new DelegateInvocation {
                        SourceObject = so
                    };
                    return(canExecuteResult);
                };
            }

            Action <SourceObject> executeAction = (so) => {
                LastExecuteInvocation = new DelegateInvocation {
                    SourceObject = so
                };
            };

            Behavior = new DelegateCommandExecutorBehavior <SourceObject>(executeAction, canExecuteFunction);
            Next     = new NextBehavior();

            Context = PropertyStub
                      .WithBehaviors(Behavior, Next)
                      .GetContext();
        }
        public void Setup()
        {
            ActionLogBuilder = new StringBuilder();
            Behavior         = new ViewModelValidationSourceBehavior();
            Next             = new NextBehavior(ActionLogBuilder);
            Executor         = new TestExecutor(ActionLogBuilder);

            VM = ViewModelStub
                 .WithBehaviors(Behavior, Next, Executor)
                 .Build();

            Context = VM.GetContext();
        }
 public void BaseSetup()
 {
     Next = new NextBehavior();
 }