public void Send_NotPublishesEvents_WhenSetInOptions() { _optionsMock .Setup(x => x.Value) .Returns(new Options { PublishEvents = false }); _sut = new DomainCommandSender(_handlerResolver.Object, _eventPublisher.Object, _eventFactory.Object, _aggregateStore.Object, _commandStore.Object, _eventStore.Object, _optionsMock.Object); _sut.Send <CreateAggregate, Aggregate>(_createAggregate); _eventPublisher.Verify(x => x.Publish(_aggregateCreatedConcrete), Times.Never); }
/// <inheritdoc /> public void Send <TCommand, TAggregate>(TCommand command) where TCommand : IDomainCommand where TAggregate : IAggregateRoot { _domainCommandSender.Send <TCommand, TAggregate>(command); }
public void Send_ThrowsException_WhenCommandIsNull() { _createAggregate = null; Assert.Throws <ArgumentNullException>(() => _sut.Send <CreateAggregate, Aggregate>(_createAggregate)); }