public async Task AsyncCommandSlimBase_T_FrameworkMethodsMustBeCalledWithData_ValueType() { ICommand command = new AsyncTestCommandSlim <int>(); bool canExecute = command.CanExecute(240); Assert.True(canExecute); Assert.Throws <NullReferenceException>(() => command.CanExecute(null)); command.Execute(240); await Assert.ThrowsAsync <NullReferenceException>(() => ((AsyncCommandSlimBase <int>)command).InternalExecuteAsync(null).AsTask()); }
public async Task AsyncCommandSlimBase_T_FrameworkMethodsMustBeCalledWithData_ReferenceType() { ICommand command = new AsyncTestCommandSlim <string>(); bool canExecute = command.CanExecute("240"); Assert.True(canExecute); Assert.Throws <ArgumentNullException>("parameter", () => command.CanExecute(null)); command.Execute("240"); await Assert.ThrowsAsync <ArgumentNullException>("parameter", () => ((AsyncCommandSlimBase <string>)command).InternalExecuteAsync(null).AsTask()); }
public async Task AsyncCommandSlimBase_FrameworkMethodsMustBeCalledWithoutData() { ICommand command = new AsyncTestCommandSlim(); bool canExecute = command.CanExecute(null); Assert.True(canExecute); Assert.Throws <ArgumentException>("parameter", () => command.CanExecute(240)); command.Execute(null); await Assert.ThrowsAsync <ArgumentException>("parameter", () => ((AsyncCommandSlimBase)command).InternalExecuteAsync(240).AsTask()); }