Skip to content

Commit

Permalink
fix: relax requirement on TProjection for ConnectedProjectionTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Apr 29, 2022
1 parent 5d35c53 commit 12cf4da
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ namespace Be.Vlaanderen.Basisregisters.ProjectionHandling.Testing
/// <typeparam name="TContext"></typeparam>
/// <typeparam name="TProjection"></typeparam>
public class ConnectedProjectionTest<TContext, TProjection>
where TProjection : ConnectedProjection<TContext>, new() where TContext : DbContext
where TProjection : ConnectedProjection<TContext> where TContext : DbContext
{
private readonly Func<TContext> _createContextFactory;
private readonly Func<TProjection> _projectionFactory;
private ConnectedProjectionScenario<TContext> _context;

/// <summary>
Expand All @@ -28,7 +29,7 @@ public ConnectedProjectionScenario<TContext> When
{
get
{
var projection = new TProjection();
var projection = _projectionFactory();
var resolver = ConcurrentResolve.WhenEqualToHandlerMessageType(projection.Handlers);
return new ConnectedProjectionScenario<TContext>(resolver);
}
Expand All @@ -38,9 +39,11 @@ public ConnectedProjectionScenario<TContext> When
/// ctor of the ConnectedProjectionTest
/// </summary>
/// <param name="createContextFactory">factory method on how to create the context</param>
public ConnectedProjectionTest(Func<TContext> createContextFactory)
/// <param name="projectionFactory">factory method on how to create the projection</param>
public ConnectedProjectionTest(Func<TContext> createContextFactory, Func<TProjection> projectionFactory)
{
_createContextFactory = createContextFactory;
_projectionFactory = projectionFactory;
}

/// <summary>
Expand Down

0 comments on commit 12cf4da

Please sign in to comment.