public void CanExecute_ShouldReturnValueFromInvokedMethod() { Action nullAction = null; var command = new Mvvm.Command(param => true, nullAction); Assert.True(command.CanExecute(null)); }
public void Constructor2_WhenArgumentsAreValid_ShouldSetFields() { var result = new Mvvm.Command(canExecute1_valid, toExecute2_valid); Assert.Throws <ApplicationException>(() => result.CanExecute(null)); Assert.Throws <ApplicationException>(() => result.Execute(null)); }
public void CanExecute_ShouldUseArgumentInInvokedMethod() { object result = null; int testValue = 2; Action nullAction = null; var command = new Mvvm.Command(param => { result = param; return(true); }, nullAction); command.CanExecute(testValue); Assert.Equal(testValue, result); }