Skip to content

Commit

Permalink
Re-fix some confusing cases
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzik committed Apr 7, 2024
1 parent 65d0fa5 commit deb91ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,11 @@ public void CanUseSessionOutsideOfScopeAfterScope(bool explicitFlush)
}
var count = 0;
Assert.DoesNotThrow(() => count = s.Query<Person>().Count(), "Failed using the session after scope.");
if (count != 1)
const int expectedCount = 1;
if (count != expectedCount)
// We are not testing that here, so just issue a warning. Do not use DodgeTransactionCompletionDelayIfRequired
// before previous assert. We want to ascertain the session is usable in any cases.
Assert.Warn($"Unexpected entity count: {count} instead of 1. The transaction seems to have a delayed commit.");
Assert.Warn($"Unexpected entity count: {count} instead of {expectedCount}. The transaction seems to have a delayed commit.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,11 @@ public void CanUseSessionOutsideOfScopeAfterScope(bool explicitFlush)
}
var count = 0;
Assert.DoesNotThrow(() => count = s.Query<Person>().Count(), "Failed using the session after scope.");
if (count != 1)
const int expectedCount = 1;
if (count != expectedCount)
// We are not testing that here, so just issue a warning. Do not use DodgeTransactionCompletionDelayIfRequired
// before previous assert. We want to ascertain the session is usable in any cases.
Assert.Warn($"Unexpected entity count: {count} instead of 1. The transaction seems to have a delayed commit.");
Assert.Warn($"Unexpected entity count: {count} instead of {expectedCount}. The transaction seems to have a delayed commit.");
}
}

Expand Down

0 comments on commit deb91ce

Please sign in to comment.