public void Not_mapped_command_with_registered_executors_should_be_executed_using_registered_executor()
        {
            var executor = MockRepository.GenerateMock<ICommandExecutor<NotMappedCommand>>();
            var sut = new NsbCommandService();
            sut.RegisterExecutor(executor);
            var command = new NotMappedCommand();
            sut.Execute(command);

            executor.AssertWasCalled(x => x.Execute(command));
        }
Ejemplo n.º 2
0
        public void Not_mapped_command_with_registered_executors_should_be_executed_using_registered_executor()
        {
            var executor = MockRepository.GenerateMock <ICommandExecutor <NotMappedCommand> >();
            var sut      = new NsbCommandService();

            sut.RegisterExecutor(executor);
            var command = new NotMappedCommand();

            sut.Execute(command);

            executor.AssertWasCalled(x => x.Execute(command));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Registers custom executor in Ncqrs runtime.
 /// </summary>
 /// <typeparam name="TCommand">Type of command which will be affected.</typeparam>
 /// <param name="executor">Custom executor instance.</param>
 /// <returns>Self.</returns>
 public EventBusConfigNcqrs RegisterExecutor <TCommand>(ICommandExecutor <TCommand> executor) where TCommand : ICommand
 {
     _commandService.RegisterExecutor(executor);
     return(this);
 }