public void ExecuteInvokeAction() { var invoked = false; var command = new RelayCommand(obj => invoked = true); command.Execute(); Assert.IsTrue(invoked); }
public void ExecuteOverloadInvokeActionWithParameter() { var invoked = false; var command = new RelayCommand(obj => { Assert.IsNotNull(obj); invoked = true; }); command.Execute(new object()); Assert.IsTrue(invoked); }
public void CanExecuteOverloadExecutesTruePredicate() { var command = new RelayCommand(obj => { }, obj => (int)obj == 1); Assert.IsTrue(command.CanExecute(1)); }
public void ConstructorThrowsExceptionIfActionParameterIsNull() { var command = new RelayCommand(null); }
public void CanExecuteIsTrueByDefault() { var command = new RelayCommand(obj => { }); Assert.IsTrue(command.CanExecute(null)); }