public void InaccessibleTypeParameterCanBeUsed()
        {
            // This test is necessary for checking that the repository can be used with inaccessible type parameters.
            // See the bug in .NET Framework: https://connect.microsoft.com/VisualStudio/feedback/details/672411/bug-in-dynamic-dispatch-when-using-generic-type-parameters

            InternalAggregateRoot aggregateRoot = new InternalAggregateRoot(Guid.NewGuid());

            aggregateRoot.ApplyEvent(domainEvent);

            var privateSut = new InternalAsyncDomainRepository(eventHandlerResolver);

            privateSut.ApplyChangesAsync(aggregateRoot).Wait();

            domainEventHandler1.Received().ExecuteAsync(domainEvent);
            domainEventHandler2.Received().ExecuteAsync(domainEvent);
        }
        public void EventHandlersAreExecutedWithSingleEvent()
        {
            sut.PublishEvent(testEvent1);

            Received.InOrder(() =>
            {
                domainEventHandler1.Received().Execute(testEvent1);
                domainEventHandler2.Received().Execute(testEvent1);
                asyncDomainEventHandler1.Received().ExecuteAsync(testEvent1);
                asyncDomainEventHandler2.Received().ExecuteAsync(testEvent1);
            });

            domainEventHandler3.DidNotReceive().Execute(Arg.Any <AnotherTestDomainEvent>());
            asyncDomainEventHandler3.DidNotReceive().ExecuteAsync(Arg.Any <AnotherTestDomainEvent>());
        }