コード例 #1
0
 public void CanExceute_ReturnsCanExecuteFunctionResult()
 {
     Setup(withCanExecutePredicate: true, canExecuteResult: false);
     Assert.IsFalse(Behavior.CanExecute(Context, null));
     Setup(withCanExecutePredicate: true, canExecuteResult: true);
     Assert.IsTrue(Behavior.CanExecute(Context, null));
 }
コード例 #2
0
 public void CanExecute_CallsCanExecutePredicateWithSourceObject()
 {
     Setup(withCanExecutePredicate: true);
     Next.SourceObject = new SourceObject();
     Behavior.CanExecute(Context, null);
     Assert.AreEqual(Next.SourceObject, LastCanExecuteInvocation.SourceObject);
 }
コード例 #3
0
 public void CanExecute_ReturnsTrueWithoutCanExecuteFunction()
 {
     Setup(withCanExecutePredicate: false);
     Assert.IsTrue(Behavior.CanExecute(Context, null));
 }