-
-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow customization of the snapshot projection
- Loading branch information
Showing
2 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...EventSourcingTests/Projections/inline_aggregation_with_custom_projection_configuration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using Marten.Events.Aggregation; | ||
using Marten.Events.Projections; | ||
using Marten.Testing.Harness; | ||
using NSubstitute; | ||
using Xunit; | ||
|
||
namespace EventSourcingTests.Projections; | ||
|
||
public class inline_aggregation_with_custom_projection_configuration : OneOffConfigurationsContext | ||
{ | ||
[Fact] | ||
public void does_call_custom_projection_configuration() | ||
{ | ||
var configureProjection = Substitute.For<Action<SingleStreamProjection<QuestParty>>>(); | ||
|
||
StoreOptions(_ => | ||
{ | ||
_.Projections.Snapshot<QuestParty>(SnapshotLifecycle.Inline, configureProjection); | ||
}); | ||
|
||
configureProjection.Received(1).Invoke(Arg.Any<SingleStreamProjection<QuestParty>>()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters