Esempio n. 1
0
        public async Task It_Executes_Without_Parameter()
        {
            var isExecuted = false;

            var strategy = new ActionCommandStrategy(() => isExecuted = true);
            var command  = new DynamicCommand(DefaultCommandName, strategy);

            await command.Execute();

            isExecuted.Should().BeTrue();
        }
Esempio n. 2
0
        public async Task It_Executes_With_Parameter_T()
        {
            var executeStrategyParameter = default(TestParameter);

            var strategy = new ActionCommandStrategy <TestParameter>(
                execute: p => executeStrategyParameter = p
                );

            var command = new DynamicCommand(DefaultCommandName, strategy);

            var parameter = new TestParameter();
            await command.Execute(parameter);

            executeStrategyParameter.Should().Be(parameter);
        }