/// <summary>
 /// Initializes a new instance of the <see cref="DomainEventDispatcher"/> class.
 /// </summary>
 /// <param name="domainEventHandlerProvider">The domain event handler provider.</param>
 /// <param name="domainEventDispatchErrorHandler">The domain event dispatch error handler.</param>
 /// <exception cref="ArgumentNullException">
 /// domainEventHandlerProvider
 /// or
 /// domainEventDispatchErrorHandler
 /// </exception>
 public DomainEventDispatcher(
     IDomainEventHandlerProvider domainEventHandlerProvider,
     IDomainEventDispatchErrorHandler domainEventDispatchErrorHandler)
 {
     _domainEventHandlerProvider      = domainEventHandlerProvider ?? throw new ArgumentNullException(nameof(domainEventHandlerProvider));
     _domainEventDispatchErrorHandler = domainEventDispatchErrorHandler ?? throw new ArgumentNullException(nameof(domainEventDispatchErrorHandler));
 }
Ejemplo n.º 2
0
        internal DomainEventRaiserSutBuilder UseTestDomainEventHandlerProvider(Action <TestDomainEventHandlerProvider> builder)
        {
            var provider = new TestDomainEventHandlerProvider();

            builder.Invoke(provider);

            _domainEventHandlerProvider = provider;

            return(this);
        }
Ejemplo n.º 3
0
 internal DomainEventRaiserSutBuilder WithDomainEventHandlerProvider(IDomainEventHandlerProvider domainEventHandlerProvider)
 {
     _domainEventHandlerProvider = domainEventHandlerProvider;
     return(this);
 }
Ejemplo n.º 4
0
 public DomainEventRaiserSutBuilder()
 {
     _domainEventDispatcher           = new Mock <IDomainEventDispatcher>().Object;
     _domainEventDispatchErrorHandler = new Mock <IDomainEventDispatchErrorHandler>().Object;
     _domainEventHandlerProvider      = new Mock <IDomainEventHandlerProvider>().Object;
 }