Skip to content

Commit deb91ce

Browse files
committed
Re-fix some confusing cases
1 parent 65d0fa5 commit deb91ce

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/NHibernate.Test/SystemTransactions/DistributedSystemTransactionFixture.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,11 @@ public void CanUseSessionOutsideOfScopeAfterScope(bool explicitFlush)
539539
}
540540
var count = 0;
541541
Assert.DoesNotThrow(() => count = s.Query<Person>().Count(), "Failed using the session after scope.");
542-
if (count != 1)
542+
const int expectedCount = 1;
543+
if (count != expectedCount)
543544
// We are not testing that here, so just issue a warning. Do not use DodgeTransactionCompletionDelayIfRequired
544545
// before previous assert. We want to ascertain the session is usable in any cases.
545-
Assert.Warn($"Unexpected entity count: {count} instead of 1. The transaction seems to have a delayed commit.");
546+
Assert.Warn($"Unexpected entity count: {count} instead of {expectedCount}. The transaction seems to have a delayed commit.");
546547
}
547548
}
548549

src/NHibernate.Test/SystemTransactions/SystemTransactionFixture.cs

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

0 commit comments

Comments
 (0)