Ejemplo n.º 1
0
        public void Executing_not_mapped_command_with_no_registered_executors_should_cause_exception()
        {
            var    sut = new NsbCommandService();
            Action act = () => sut.Execute(new NotMappedCommand());

            act.ShouldThrow <ExecutorForCommandNotFoundException>();
        }
        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
        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));
        }
 public void Mapped_command_with_no_registered_executors_should_be_executed_using_mapped_executor()
 {
     var sut = new NsbCommandService();
     sut.Execute(new MappedCommand());
 }
 public void Executing_not_mapped_command_with_no_registered_executors_should_cause_exception()
 {
     var sut = new NsbCommandService();
     Action act = () => sut.Execute(new NotMappedCommand());
     act.ShouldThrow<ExecutorForCommandNotFoundException>();
 }
Ejemplo n.º 6
0
        public void Mapped_command_with_no_registered_executors_should_be_executed_using_mapped_executor()
        {
            var sut = new NsbCommandService();

            sut.Execute(new MappedCommand());
        }