-
-
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.
Test just to prove that projected documents dont' accidentally get op…
…timistic concurrency from the policy. Closes GH-2978
- Loading branch information
1 parent
8093b54
commit db9a162
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...8_aggregate_projection_documents_are_not_optimistic_concurrency_event_with_that_policy.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,29 @@ | ||
using EventSourcingTests.Aggregation; | ||
using Marten; | ||
using Marten.Events.Projections; | ||
using Marten.Testing.Documents; | ||
using Marten.Testing.Harness; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace EventSourcingTests.Bugs; | ||
|
||
public class Bug_2978_aggregate_projection_documents_are_not_optimistic_concurrency_event_with_that_policy : BugIntegrationContext | ||
{ | ||
[Fact] | ||
public void override_the_optimistic_concurrency_on_projected_document() | ||
{ | ||
StoreOptions(opts => | ||
{ | ||
opts.Policies.AllDocumentsEnforceOptimisticConcurrency(); | ||
opts.Projections.Add<AllGood>(ProjectionLifecycle.Async); | ||
}); | ||
|
||
var mapping = theStore.Options.Storage.MappingFor(typeof(MyAggregate)); | ||
mapping.UseNumericRevisions.ShouldBeTrue(); | ||
mapping.UseOptimisticConcurrency.ShouldBeFalse(); | ||
|
||
theStore.Options.Storage.MappingFor(typeof(Target)) | ||
.UseOptimisticConcurrency.ShouldBeTrue(); | ||
} | ||
} |
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