public async Task It_Executes_Without_Parameter() { var isExecuted = false; var strategy = new TaskCommandStrategy(ct => { isExecuted = true; return(Task.CompletedTask); }); var command = new DynamicCommand(DefaultCommandName, strategy); await command.Execute(); isExecuted.Should().BeTrue(); }
public async Task It_Executes_With_Parameter_T() { var executeStrategyParameter = default(TestParameter); var strategy = new TaskCommandStrategy <TestParameter>( execute: (ct, p) => { executeStrategyParameter = p; return(Task.CompletedTask); } ); var command = new DynamicCommand(DefaultCommandName, strategy); var parameter = new TestParameter(); await command.Execute(parameter); executeStrategyParameter.Should().Be(parameter); }