@@ -4,6 +4,11 @@ namespace NHibernate.Test.NHSpecificTest.NH1391
44 [ TestFixture ]
55 public class Fixture : BugTestCase
66 {
7+ private object _idOfPersonWithAnimals ;
8+ private object _idOfPersonWithCats ;
9+ private object _idOfPersonWithDogs ;
10+ private object _idOfPersonWithSivasKangals ;
11+
712 protected override void OnSetUp ( )
813 {
914 using ( var session = OpenSession ( ) )
@@ -51,10 +56,10 @@ protected override void OnSetUp()
5156 session . Save ( dogForSivasKangals ) ;
5257 session . Save ( catForSivasKangals ) ;
5358
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 ) ;
5863
5964
6065
@@ -79,10 +84,10 @@ public void Can_discriminate_subclass_on_list_with_lazy_loading_when_used_get()
7984 using ( var session = OpenSession ( ) )
8085 using ( var tran = session . BeginTransaction ( ) )
8186 {
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 ) ;
8691
8792 Assert . That ( personWithAnimals . AnimalsGeneric , Has . Count . EqualTo ( 4 ) ) ;
8893
0 commit comments