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 Execute_ShouldUseArgumentInInvokedMethod() { object result = null; int testValue = 2; var command = new Mvvm.Command(() => true, param => result = param); command.Execute(testValue); Assert.Equal(testValue, result); }