public void ShouldThrowWhenNoRegisteredAttributeQueryHandlerIsFound()
            {
                var          registration = new QueryHandlerAttributeRegistration();
                var          dispatcher   = new LoggingQueryDispatcher(new QueryDispatcher(registration), _outputHelper);
                const string data         = nameof(ShouldThrowWhenNoRegisteredAttributeQueryHandlerIsFound);

                Action action = () => dispatcher.Dispatch <QuerySomething, string>(new QuerySomething(data));

                action.Should().Throw <NoQueryHandlerResolvedException>();
            }
            public void ShouldPropagateExceptionFromQueryHandler()
            {
                var registration = new QueryHandlerRegistration();

                registration.Register(() => (IQueryHandler <QuerySomethingWithException, string>) new TestQueryHandler(_outputHelper));
                var dispatcher = new LoggingQueryDispatcher(new QueryDispatcher(registration), _outputHelper);

                Action action = () => dispatcher.Dispatch <QuerySomethingWithException, string>(
                    new QuerySomethingWithException("This will cause an exception."));

                action.Should().Throw <TestQueryHandlerException>();
            }
            public void ShouldThrowWhenNoRegisteredQueryHandlerInContainerIsFound()
            {
                var          container        = new Container();
                var          containerAdapter = new SimpleInjectorContainerAdapter(container);
                var          resolver         = new ContainerQueryHandlerResolver(containerAdapter); // Sync handler resolver
                var          dispatcher       = new LoggingQueryDispatcher(new QueryDispatcher(resolver), _outputHelper);
                const string data             = nameof(ShouldThrowWhenNoRegisteredAttributeQueryHandlerIsFound);

                Action action = () => dispatcher.Dispatch <QuerySomething, string>(new QuerySomething(data));

                action.Should().Throw <NoQueryHandlerResolvedException>();
            }