public async Task PublishAsync_should_throw_if_message_null() { var repo = NSubstitute.Substitute.For <IOutboxRepository>(); var sut = new DefaultMessageBus(repo); await Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.PublishAsync <StartDummySaga>(null)); }
public static Configuration InitializeCQRSAssemblies(this Configuration configuration, IEventStore es, Assembly[] assemblies) { DefaultMessageBus dispatcher = new DefaultMessageBus(es); dispatcher.ScanAssembly(assemblies); Configuration.Instance.SetDefault <DefaultMessageBus, DefaultMessageBus>(dispatcher); return(configuration); }
public async Task PublishAsync_should_append_to_outbox() { var repo = NSubstitute.Substitute.For <IOutboxRepository>(); var sut = new DefaultMessageBus(repo); var message = StartDummySaga.New(); await sut.PublishAsync(message); await repo.Received(1).AppendAsync(message, Arg.Any <CancellationToken>()); }
public void Can_send_and_receive_messages() { bool seen = false; var mb = new DefaultMessageBus(); mb.Subscribe<ITestMessage>(msg => { seen = msg.Test == "1"; }); mb.Send<ITestMessage>(msgBuilder => { msgBuilder.Test = "1"; }).Wait(); Assert.IsTrue(seen); }
public async Task PublishAsync_should_pass_transaction_if_set() { var repo = NSubstitute.Substitute.For <IOutboxRepository>(); var sut = new DefaultMessageBus(repo); var message = StartDummySaga.New(); var transaction = NSubstitute.Substitute.For <ITransaction>(); sut.SetTransaction(transaction); await sut.PublishAsync(message); await repo.Received(1).AppendAsync(message, transaction, Arg.Any <CancellationToken>()); }
public UserController(DefaultMessageBus messageDispatcher, UserView userView) { _messageDispatcher = messageDispatcher; _userView = userView; }
public RoleController(DefaultMessageBus messageDispatcher, RoleView roleView) { _messageDispatcher = messageDispatcher; _roleView = roleView; }
public ReadModelController(DefaultMessageBus messageDispatcher) { _messageDispatcher = messageDispatcher; }
public CategoryTypeSchemeController(DefaultMessageBus messageDispatcher, CategoryTypeSchemeView categoryTypeSchemeView) { _messageDispatcher = messageDispatcher; _categoryTypeSchemeView = categoryTypeSchemeView; }
public PartyRoleController(DefaultMessageBus messageDispatcher, PartyRoleView partyRoleView) { _messageDispatcher = messageDispatcher; _partyRoleView = partyRoleView; }
public AssociationController(DefaultMessageBus messageDispatcher, AssociationView associationView) { _messageDispatcher = messageDispatcher; _associationView = associationView; }
public PopTemplateController(DefaultMessageBus messageDispatcher, PopTemplateView popTemplateView) { _messageDispatcher = messageDispatcher; _popTemplateView = popTemplateView; }
public InitData() { _messageDispatcher = ObjectContainer.Resolve <DefaultMessageBus>(); }
public DdlController(DefaultMessageBus messageDispatcher, DropDownView dropDownView, UserView userView) { _messageDispatcher = messageDispatcher; _dropDownView = dropDownView; _userView = userView; }
public EntityController(DefaultMessageBus messageDispatcher, EntityView entityView) { _messageDispatcher = messageDispatcher; _entityView = entityView; }
public FieldController(DefaultMessageBus messageDispatcher, FieldView fieldView, CategoryView categoryView) { _messageDispatcher = messageDispatcher; _fieldView = fieldView; _categoryView = categoryView; }
public ModuleController(DefaultMessageBus messageDispatcher, ModuleView moduleView) { _messageDispatcher = messageDispatcher; _moduleView = moduleView; }