|
2 | 2 | using NHibernate.Linq;
|
3 | 3 | using NUnit.Framework;
|
4 | 4 |
|
5 |
| -namespace NHibernate.Test.NHSpecificTest.GH3288; |
6 |
| - |
7 |
| -[TestFixture] |
8 |
| -public class FetchAndCollectionJoinFixture : BugTestCase |
| 5 | +namespace NHibernate.Test.NHSpecificTest.GH3288 |
9 | 6 | {
|
10 |
| - protected override void OnSetUp() |
| 7 | + [TestFixture] |
| 8 | + public class FetchAndCollectionJoinFixture : BugTestCase |
11 | 9 | {
|
12 |
| - using var session = OpenSession(); |
13 |
| - using var transaction = session.BeginTransaction(); |
14 |
| - var middleEntity = new MiddleEntity(); |
15 |
| - middleEntity.Components.Add(new Component { MiddleEntity = middleEntity, Value = 1 }); |
16 |
| - var te = new TopEntity |
| 10 | + protected override void OnSetUp() |
17 | 11 | {
|
18 |
| - MiddleEntity = middleEntity |
19 |
| - }; |
20 |
| - session.Save(middleEntity); |
21 |
| - session.Save(te); |
| 12 | + using var session = OpenSession(); |
| 13 | + using var transaction = session.BeginTransaction(); |
| 14 | + var middleEntity = new MiddleEntity(); |
| 15 | + middleEntity.Components.Add(new Component { MiddleEntity = middleEntity, Value = 1 }); |
| 16 | + var te = new TopEntity |
| 17 | + { |
| 18 | + MiddleEntity = middleEntity |
| 19 | + }; |
| 20 | + session.Save(middleEntity); |
| 21 | + session.Save(te); |
22 | 22 |
|
23 |
| - transaction.Commit(); |
24 |
| - } |
| 23 | + transaction.Commit(); |
| 24 | + } |
25 | 25 |
|
26 |
| - protected override void OnTearDown() |
27 |
| - { |
28 |
| - using var session = OpenSession(); |
29 |
| - using var transaction = session.BeginTransaction(); |
30 |
| - session.Delete("from System.Object"); |
| 26 | + protected override void OnTearDown() |
| 27 | + { |
| 28 | + using var session = OpenSession(); |
| 29 | + using var transaction = session.BeginTransaction(); |
| 30 | + session.Delete("from System.Object"); |
31 | 31 |
|
32 |
| - transaction.Commit(); |
33 |
| - } |
| 32 | + transaction.Commit(); |
| 33 | + } |
34 | 34 |
|
35 |
| - [Test] |
36 |
| - public void ReuseEntityJoinWithCollectionJoin() |
37 |
| - { |
38 |
| - using var session = OpenSession(); |
| 35 | + [Test] |
| 36 | + public void ReuseEntityJoinWithCollectionJoin() |
| 37 | + { |
| 38 | + using var session = OpenSession(); |
39 | 39 |
|
40 |
| - var entities = session.Query<TopEntity>() |
41 |
| - .Fetch(e => e.MiddleEntity) |
42 |
| - .Where(e => e.MiddleEntity.Components.Any(e => e.Value != 0)) |
43 |
| - .ToList(); |
44 |
| - Assert.That(entities.Count, Is.EqualTo(1)); |
| 40 | + var entities = session.Query<TopEntity>() |
| 41 | + .Fetch(e => e.MiddleEntity) |
| 42 | + .Where(e => e.MiddleEntity.Components.Any(e => e.Value != 0)) |
| 43 | + .ToList(); |
| 44 | + Assert.That(entities.Count, Is.EqualTo(1)); |
| 45 | + } |
45 | 46 | }
|
46 | 47 | }
|
0 commit comments