Skip to content

Commit dcdebc6

Browse files
committed
Fixed test warnings
1 parent 960e2e8 commit dcdebc6

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/NHibernate.Test/Async/NHSpecificTest/GH948/FixtureByCode.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,27 +311,26 @@ public async Task MultipleEntitiesProjectionsToResultTransformerAsync()
311311
using (var sqlLog = new SqlLogSpy())
312312
using (var session = OpenSession())
313313
{
314-
MultipleEntitiesResult result = new MultipleEntitiesResult();
314+
MultipleEntitiesResult r = null;
315315

316-
EntityComplex root = null;
317316
EntitySimpleChild child1 = null;
318317
EntitySimpleChild child2 = null;
319318
EntityComplex sameAsRootChild = null;
320319
EntitySimpleChild nullListElem = null;
321-
var r = await (session
320+
321+
r = await (session
322322
.QueryOver<EntityComplex>()
323323
.JoinAlias(ep => ep.Child1, () => child1)
324324
.JoinAlias(ep => ep.Child2, () => child2)
325325
.JoinAlias(ep => ep.SameTypeChild, () => sameAsRootChild)
326326
.JoinAlias(ep => ep.ChildrenList, () => nullListElem, JoinType.LeftOuterJoin)
327327
.Select(
328-
Projections.Alias(Projections.RootEntity(), nameof(result.Root)),
328+
Projections.Alias(Projections.RootEntity(), nameof(r.Root)),
329329
Projections.Entity(() => child1),
330330
Projections.Entity(() => child2),
331331
Projections.Entity(() => sameAsRootChild),
332332
Projections.Entity(() => nullListElem)
333333
)
334-
335334
.TransformUsing(Transformers.AliasToBean<MultipleEntitiesResult>())
336335
.Take(1)
337336
.SingleOrDefaultAsync<MultipleEntitiesResult>());

src/NHibernate.Test/NHSpecificTest/GH948/FixtureByCode.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,27 +300,26 @@ public void MultipleEntitiesProjectionsToResultTransformer()
300300
using (var sqlLog = new SqlLogSpy())
301301
using (var session = OpenSession())
302302
{
303-
MultipleEntitiesResult result = new MultipleEntitiesResult();
303+
MultipleEntitiesResult r = null;
304304

305-
EntityComplex root = null;
306305
EntitySimpleChild child1 = null;
307306
EntitySimpleChild child2 = null;
308307
EntityComplex sameAsRootChild = null;
309308
EntitySimpleChild nullListElem = null;
310-
var r = session
309+
310+
r = session
311311
.QueryOver<EntityComplex>()
312312
.JoinAlias(ep => ep.Child1, () => child1)
313313
.JoinAlias(ep => ep.Child2, () => child2)
314314
.JoinAlias(ep => ep.SameTypeChild, () => sameAsRootChild)
315315
.JoinAlias(ep => ep.ChildrenList, () => nullListElem, JoinType.LeftOuterJoin)
316316
.Select(
317-
Projections.Alias(Projections.RootEntity(), nameof(result.Root)),
317+
Projections.Alias(Projections.RootEntity(), nameof(r.Root)),
318318
Projections.Entity(() => child1),
319319
Projections.Entity(() => child2),
320320
Projections.Entity(() => sameAsRootChild),
321321
Projections.Entity(() => nullListElem)
322322
)
323-
324323
.TransformUsing(Transformers.AliasToBean<MultipleEntitiesResult>())
325324
.Take(1)
326325
.SingleOrDefault<MultipleEntitiesResult>();

0 commit comments

Comments
 (0)