-
-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'projection-configuration' into quick-append-revision-fix
- Loading branch information
Showing
12 changed files
with
161 additions
and
2 deletions.
There are no files selected for viewing
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
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
38 changes: 38 additions & 0 deletions
38
src/EventSourcingTests/Projections/SingleStreamProjectionTests.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,38 @@ | ||
using Marten; | ||
using Marten.Events; | ||
using Marten.Events.Aggregation; | ||
using Marten.Schema; | ||
using Marten.Testing.Documents; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace EventSourcingTests.Projections; | ||
|
||
public class SingleStreamProjectionTests | ||
{ | ||
[Fact] | ||
public void set_mapping_to_UseVersionFromMatchingStream_when_quick_append() | ||
{ | ||
var projection = new SingleStreamProjection<User>(); | ||
var mapping = DocumentMapping.For<User>(); | ||
|
||
mapping.StoreOptions.EventGraph.AppendMode = EventAppendMode.Quick; | ||
|
||
projection.ConfigureAggregateMapping(mapping, mapping.StoreOptions); | ||
|
||
mapping.UseVersionFromMatchingStream.ShouldBeTrue(); | ||
} | ||
|
||
[Fact] | ||
public void do_not_set_mapping_to_UseVersionFromMatchingStream_when_rich_append() | ||
{ | ||
var projection = new SingleStreamProjection<User>(); | ||
var mapping = DocumentMapping.For<User>(); | ||
|
||
mapping.StoreOptions.EventGraph.AppendMode = EventAppendMode.Rich; | ||
|
||
projection.ConfigureAggregateMapping(mapping, mapping.StoreOptions); | ||
|
||
mapping.UseVersionFromMatchingStream.ShouldBeFalse(); | ||
} | ||
} |
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
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
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
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
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
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
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
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
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