public void When_attempting_to_register_a_null_reference_as_command_handler_then_an_argument_null_exception_is_thrown() { var sut = new ConnectedProjectionsCommandBus(); Action act = () => sut.Register(null); act.Should().Throw <ArgumentNullException>(); }
public void When_attempting_to_register_a_command_handler_for_a_second_time_then_an_already_registered_exception_is_thrown() { Action act = () => _sut.Register(new Mock <IConnectedProjectionsCommandHandler>().Object); act.Should() .Throw <Exception>() .WithMessage("CommandHandler is already assigned"); }
public CommandBusTests() { _fixture = new Fixture() .CustomizeConnectedProjectionNames() .CustomizeConnectedProjectionCommands(); _commandHandlerMock = new Mock <IConnectedProjectionsCommandHandler>(); var commandBus = new ConnectedProjectionsCommandBus(); commandBus.Register(_commandHandlerMock.Object); _sut = commandBus; }