public async Task ShouldExecuteOpenGenericQueryHandler()
        {
            var container = new ServiceContainer();

            container.RegisterQueryHandlers();
            using (var scope = container.BeginScope())
            {
                var queryExecutor = scope.GetInstance <IQueryExecutor>();
                var handler       = container.GetInstance <IQueryHandler <OpenGenericQuery <Derived>, Derived> >();
                var query         = new OpenGenericQuery <Derived>();
                var result        = await queryExecutor.ExecuteAsync(query);

                query.WasHandled.Should().BeTrue();
            }
        }
 public Task <TResult> HandleAsync(OpenGenericQuery <TResult> query, CancellationToken cancellationToken = default)
 {
     query.WasHandled = true;
     return(Task.FromResult(default(TResult)));
 }