public void When_Dependant_Changes_On_CanExecute_It_Does_Not_Execute() { dynamic viewModel = new Automatic_Command_Properties(); viewModel.Text = "Something"; Assert.That(viewModel.CanExecuteSomethingWasExecuted, Is.False); }
public void CanExecute_Method_Is_Wrapped_By_Dynamic_Property(bool predicateResult) { dynamic viewModel = new Automatic_Command_Properties(); viewModel.CanExecuteResult = predicateResult; Assert.That(viewModel.Something.CanExecute(null), Is.EqualTo(predicateResult)); }
public void Execute_Method_Is_Wrapped_By_Dynamic_Property() { dynamic viewModel = new Automatic_Command_Properties(); viewModel.Something.Execute(null); Assert.That(viewModel.SomethingWasExecuted); }
public void Execute_Method_Generates_ICommand_Property() { dynamic viewModel = new Automatic_Command_Properties(); var command = viewModel.Something; Assert.That(command is ICommand); }
public void Changing_Text_Causes_CanExecuteChanged_To_Fire() { dynamic viewModel = new Automatic_Command_Properties(); bool CanExecuteChanged_Fired = false; (viewModel.Something as ICommand).CanExecuteChanged += (s, e) => CanExecuteChanged_Fired = true; viewModel.Text = "Foo"; Assert.That(CanExecuteChanged_Fired); }