File tree Expand file tree Collapse file tree 6 files changed +24
-27
lines changed
NHibernate.Test/MultipleCollectionFetchTest Expand file tree Collapse file tree 6 files changed +24
-27
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections ;
3
-
3
+ using System . Collections . Generic ;
4
4
using NUnit . Framework ;
5
5
6
6
namespace NHibernate . Test . MultipleCollectionFetchTest
@@ -12,9 +12,9 @@ protected override string MappingsAssembly
12
12
get { return "NHibernate.Test" ; }
13
13
}
14
14
15
- protected abstract void AddToCollection ( ICollection collection , Person person ) ;
15
+ protected abstract void AddToCollection ( ICollection < Person > collection , Person person ) ;
16
16
17
- protected abstract ICollection CreateCollection ( ) ;
17
+ protected abstract ICollection < Person > CreateCollection ( ) ;
18
18
19
19
protected override void OnTearDown ( )
20
20
{
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections ;
3
-
3
+ using System . Collections . Generic ;
4
4
using NUnit . Framework ;
5
5
6
6
namespace NHibernate . Test . MultipleCollectionFetchTest
@@ -13,14 +13,14 @@ protected override IList Mappings
13
13
get { return new string [ ] { "MultipleCollectionFetchTest.PersonBag.hbm.xml" } ; }
14
14
}
15
15
16
- protected override void AddToCollection ( ICollection collection , Person person )
16
+ protected override void AddToCollection ( ICollection < Person > collection , Person person )
17
17
{
18
- ( ( ArrayList ) collection ) . Add ( person ) ;
18
+ ( ( List < Person > ) collection ) . Add ( person ) ;
19
19
}
20
20
21
- protected override ICollection CreateCollection ( )
21
+ protected override ICollection < Person > CreateCollection ( )
22
22
{
23
- return new ArrayList ( ) ;
23
+ return new List < Person > ( ) ;
24
24
}
25
25
26
26
protected override void RunLinearJoinFetchTest ( Person parent )
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections ;
3
-
3
+ using System . Collections . Generic ;
4
4
using NUnit . Framework ;
5
5
6
6
namespace NHibernate . Test . MultipleCollectionFetchTest
@@ -13,14 +13,14 @@ protected override IList Mappings
13
13
get { return new string [ ] { "MultipleCollectionFetchTest.PersonList.hbm.xml" } ; }
14
14
}
15
15
16
- protected override void AddToCollection ( ICollection collection , Person person )
16
+ protected override void AddToCollection ( ICollection < Person > persons , Person person )
17
17
{
18
- ( ( ArrayList ) collection ) . Add ( person ) ;
18
+ ( ( List < Person > ) persons ) . Add ( person ) ;
19
19
}
20
20
21
- protected override ICollection CreateCollection ( )
21
+ protected override ICollection < Person > CreateCollection ( )
22
22
{
23
- return new ArrayList ( ) ;
23
+ return new List < Person > ( ) ;
24
24
}
25
25
}
26
26
}
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections ;
3
- using System . Net . NetworkInformation ;
3
+ using System . Collections . Generic ;
4
4
using NUnit . Framework ;
5
5
6
6
namespace NHibernate . Test . MultipleCollectionFetchTest
7
7
{
8
8
[ TestFixture ]
9
- [ Ignore ( "Support for non-generic sets removed. To test generic set instead, need to duplicate or port the sister test fixtures too." ) ]
10
9
public class MultipleSetFetchFixture : AbstractMultipleCollectionFetchFixture
11
10
{
12
11
protected override IList Mappings
13
12
{
14
13
get { return new string [ ] { "MultipleCollectionFetchTest.PersonSet.hbm.xml" } ; }
15
14
}
16
15
17
- protected override void AddToCollection ( ICollection collection , Person person )
16
+ protected override void AddToCollection ( ICollection < Person > persons , Person person )
18
17
{
19
- //((ISet) collection).Add(person);
20
- throw new NotImplementedException ( ) ;
18
+ ( ( ISet < Person > ) persons ) . Add ( person ) ;
21
19
}
22
20
23
- protected override ICollection CreateCollection ( )
21
+ protected override ICollection < Person > CreateCollection ( )
24
22
{
25
- throw new NotImplementedException ( ) ;
26
- //return new HashSet();
23
+ return new HashSet < Person > ( ) ;
27
24
}
28
25
}
29
26
}
Original file line number Diff line number Diff line change 1
1
using System ;
2
- using System . Collections ;
2
+ using System . Collections . Generic ;
3
3
4
4
namespace NHibernate . Test . MultipleCollectionFetchTest
5
5
{
6
6
public class Person
7
7
{
8
8
private int id ;
9
- private ICollection children ;
10
- private ICollection friends ;
9
+ private ICollection < Person > children ;
10
+ private ICollection < Person > friends ;
11
11
private Person parent ;
12
12
13
13
public virtual int Id
@@ -16,13 +16,13 @@ public virtual int Id
16
16
set { id = value ; }
17
17
}
18
18
19
- public virtual ICollection Children
19
+ public virtual ICollection < Person > Children
20
20
{
21
21
get { return children ; }
22
22
set { children = value ; }
23
23
}
24
24
25
- public virtual ICollection Friends
25
+ public virtual ICollection < Person > Friends
26
26
{
27
27
get { return friends ; }
28
28
set { friends = value ; }
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ protected override void PostInstantiate()
68
68
69
69
private static bool IsBag ( ICollectionPersister collectionPersister )
70
70
{
71
- return collectionPersister . CollectionType . GetType ( ) . IsAssignableFrom ( typeof ( BagType ) ) ;
71
+ return collectionPersister . CollectionType is BagType ;
72
72
}
73
73
74
74
/// <summary>
You can’t perform that action at this time.
0 commit comments