@@ -4,6 +4,11 @@ namespace NHibernate.Test.NHSpecificTest.NH1391
4
4
[ TestFixture ]
5
5
public class Fixture : BugTestCase
6
6
{
7
+ private object _idOfPersonWithAnimals ;
8
+ private object _idOfPersonWithCats ;
9
+ private object _idOfPersonWithDogs ;
10
+ private object _idOfPersonWithSivasKangals ;
11
+
7
12
protected override void OnSetUp ( )
8
13
{
9
14
using ( var session = OpenSession ( ) )
@@ -51,10 +56,10 @@ protected override void OnSetUp()
51
56
session . Save ( dogForSivasKangals ) ;
52
57
session . Save ( catForSivasKangals ) ;
53
58
54
- session . Save ( personWithAnimals ) ;
55
- session . Save ( personWithCats ) ;
56
- session . Save ( personWithDogs ) ;
57
- session . Save ( personWithSivasKangals ) ;
59
+ _idOfPersonWithAnimals = session . Save ( personWithAnimals ) ;
60
+ _idOfPersonWithCats = session . Save ( personWithCats ) ;
61
+ _idOfPersonWithDogs = session . Save ( personWithDogs ) ;
62
+ _idOfPersonWithSivasKangals = session . Save ( personWithSivasKangals ) ;
58
63
59
64
60
65
@@ -79,10 +84,10 @@ public void Can_discriminate_subclass_on_list_with_lazy_loading_when_used_get()
79
84
using ( var session = OpenSession ( ) )
80
85
using ( var tran = session . BeginTransaction ( ) )
81
86
{
82
- var personWithAnimals = session . Get < PersonWithAnimals > ( 1 ) ;
83
- var personWithCats = session . Get < PersonWithCats > ( 2 ) ;
84
- var personWithDogs = session . Get < PersonWithDogs > ( 3 ) ;
85
- var personWithSivasKangals = session . Get < PersonWithSivasKangals > ( 4 ) ;
87
+ var personWithAnimals = session . Get < PersonWithAnimals > ( _idOfPersonWithAnimals ) ;
88
+ var personWithCats = session . Get < PersonWithCats > ( _idOfPersonWithCats ) ;
89
+ var personWithDogs = session . Get < PersonWithDogs > ( _idOfPersonWithDogs ) ;
90
+ var personWithSivasKangals = session . Get < PersonWithSivasKangals > ( _idOfPersonWithSivasKangals ) ;
86
91
87
92
Assert . That ( personWithAnimals . AnimalsGeneric , Has . Count . EqualTo ( 4 ) ) ;
88
93
0 commit comments