Skip to content

Commit 8071f03

Browse files
David EllingsworthDavid Ellingsworth
authored andcommitted
GH2201: Correct failing tests due to change in how objects are loaded.
1 parent 56c1bb8 commit 8071f03

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/NHibernate.Test/Async/Immutable/EntityWithMutableCollection/AbstractEntityWithOneToManyTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,6 @@ public virtual async Task OneToManyCollectionOptimisticLockingWithUpdateAsync()
12341234

12351235
s = OpenSession();
12361236
t = s.BeginTransaction();
1237-
c = await (s.CreateCriteria<Contract>().UniqueResultAsync<Contract>());
12381237
// If the entity uses a join mapping, DML queries require temp tables.
12391238
if (Dialect.SupportsTemporaryTables)
12401239
await (s.CreateQuery("delete from Party").ExecuteUpdateAsync());
@@ -1251,7 +1250,7 @@ public virtual async Task OneToManyCollectionOptimisticLockingWithUpdateAsync()
12511250
await (s.DeleteAsync(partyOrig));
12521251
await (s.DeleteAsync(newParty));
12531252
}
1254-
1253+
c = await (s.CreateCriteria<Contract>().UniqueResultAsync<Contract>());
12551254
await (s.DeleteAsync(c));
12561255
Assert.That(await (s.CreateCriteria<Contract>().SetProjection(Projections.RowCountInt64()).UniqueResultAsync<long>()), Is.EqualTo(0L));
12571256
Assert.That(await (s.CreateCriteria<Party>().SetProjection(Projections.RowCountInt64()).UniqueResultAsync<long>()), Is.EqualTo(0L));

src/NHibernate.Test/Immutable/EntityWithMutableCollection/AbstractEntityWithOneToManyTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,6 @@ public virtual void OneToManyCollectionOptimisticLockingWithUpdate()
12231223

12241224
s = OpenSession();
12251225
t = s.BeginTransaction();
1226-
c = s.CreateCriteria<Contract>().UniqueResult<Contract>();
12271226
// If the entity uses a join mapping, DML queries require temp tables.
12281227
if (Dialect.SupportsTemporaryTables)
12291228
s.CreateQuery("delete from Party").ExecuteUpdate();
@@ -1240,7 +1239,7 @@ public virtual void OneToManyCollectionOptimisticLockingWithUpdate()
12401239
s.Delete(partyOrig);
12411240
s.Delete(newParty);
12421241
}
1243-
1242+
c = s.CreateCriteria<Contract>().UniqueResult<Contract>();
12441243
s.Delete(c);
12451244
Assert.That(s.CreateCriteria<Contract>().SetProjection(Projections.RowCountInt64()).UniqueResult<long>(), Is.EqualTo(0L));
12461245
Assert.That(s.CreateCriteria<Party>().SetProjection(Projections.RowCountInt64()).UniqueResult<long>(), Is.EqualTo(0L));

0 commit comments

Comments
 (0)