Skip to content

Commit 5e39340

Browse files
committed
Tests adjustments and commented
1 parent 2a02786 commit 5e39340

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/NHibernate.Test/Async/Futures/QueryBatchFixture.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,10 @@ public async Task CanFetchNonLazyEntitiesInSubsequentQueryAsync()
520520
Sfi.Statistics.Clear();
521521
//EntityEager.EagerEntity is lazy initialized instead of being loaded by the second query
522522
s.QueryOver<EntityEager>().Fetch(SelectMode.Skip, x => x.EagerEntity).Future();
523-
s.QueryOver<EntityEager>().Fetch(SelectMode.Fetch, x => x.EagerEntity).Future().ToList();
524-
Assert.That(Sfi.Statistics.PrepareStatementCount, Is.EqualTo(1));
523+
await (s.QueryOver<EntityEager>().Fetch(SelectMode.Fetch, x => x.EagerEntity).Future().GetEnumerableAsync());
524+
525+
if(SupportsMultipleQueries)
526+
Assert.That(Sfi.Statistics.PrepareStatementCount, Is.EqualTo(1));
525527
}
526528
}
527529

src/NHibernate.Test/Futures/QueryBatchFixture.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,10 @@ public void CanFetchNonLazyEntitiesInSubsequentQuery()
508508
Sfi.Statistics.Clear();
509509
//EntityEager.EagerEntity is lazy initialized instead of being loaded by the second query
510510
s.QueryOver<EntityEager>().Fetch(SelectMode.Skip, x => x.EagerEntity).Future();
511-
s.QueryOver<EntityEager>().Fetch(SelectMode.Fetch, x => x.EagerEntity).Future().ToList();
512-
Assert.That(Sfi.Statistics.PrepareStatementCount, Is.EqualTo(1));
511+
s.QueryOver<EntityEager>().Fetch(SelectMode.Fetch, x => x.EagerEntity).Future().GetEnumerable();
512+
513+
if(SupportsMultipleQueries)
514+
Assert.That(Sfi.Statistics.PrepareStatementCount, Is.EqualTo(1));
513515
}
514516
}
515517

src/NHibernate/Loader/Loader.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,9 @@ internal void InitializeEntitiesAndCollections(
672672
}
673673
}
674674

675+
/// <summary>
676+
/// Stops further collection population without actual collection initialization.
677+
/// </summary>
675678
internal void StopLoadingCollections(ISessionImplementor session, DbDataReader reader)
676679
{
677680
var collectionPersisters = CollectionPersisters;

0 commit comments

Comments
 (0)