コード例 #1
0
        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);
        }
コード例 #2
0
 /// <inheritdoc />
 public void Send <TCommand, TAggregate>(TCommand command)
     where TCommand : IDomainCommand
     where TAggregate : IAggregateRoot
 {
     _domainCommandSender.Send <TCommand, TAggregate>(command);
 }
コード例 #3
0
 public void Send_ThrowsException_WhenCommandIsNull()
 {
     _createAggregate = null;
     Assert.Throws <ArgumentNullException>(() => _sut.Send <CreateAggregate, Aggregate>(_createAggregate));
 }