Skip to content

Commit

Permalink
Persistence Tests - Make sure stale records are modified before save (#…
Browse files Browse the repository at this point in the history
…6603) (#6605)

* Make sure stale records are modified before save

Co-Authored-By: Daniel Marbach <daniel.marbach@openplace.net>

* Update the stale record outside the Assert

Co-authored-by: Daniel Marbach <daniel.marbach@openplace.net>

Co-authored-by: Daniel Marbach <daniel.marbach@openplace.net>
  • Loading branch information
mauroservienti and danielmarbach committed Nov 24, 2022
1 parent ad93cbd commit 051959b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public async Task Save_should_fail_when_data_changes_between_read_and_update()

try
{
staleRecord.DateTimeProperty = DateTime.UtcNow.AddHours(1);
Assert.CatchAsync<Exception>(async () =>
{
await persister.Update(staleRecord, losingSaveSession, losingContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public async Task Save_process_is_repeatable()

try
{
staleRecord1.DateTimeProperty = DateTime.UtcNow.AddHours(1);
Assert.That(async () =>
{
await persister.Update(staleRecord1, losingSaveSession1, losingContext1);
Expand Down Expand Up @@ -80,6 +81,7 @@ public async Task Save_process_is_repeatable()

try
{
staleRecord2.DateTimeProperty = DateTime.UtcNow.AddHours(1);
Assert.That(async () =>
{
await persister.Update(staleRecord2, losingSaveSession2, losingContext2);
Expand Down

0 comments on commit 051959b

Please sign in to comment.