File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
NHibernate.Test/UtilityTest
NHibernate/Collection/Generic/SetHelpers Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,16 @@ public void TestInitialization()
4949 Assert . That ( sn . TryGetValue ( null , out _ ) , Is . True ) ;
5050 }
5151
52+ [ Test ]
53+ public void TestDuplicates ( )
54+ {
55+ var list = new List < string > { "test1" , "test1" , "test2" } ;
56+ var sn = new SetSnapShot < string > ( list ) ;
57+ Assert . That ( sn , Has . Count . EqualTo ( 2 ) ) ;
58+ Assert . That ( sn . TryGetValue ( "test1" , out _ ) , Is . True ) ;
59+ Assert . That ( sn . TryGetValue ( "test2" , out _ ) , Is . True ) ;
60+ }
61+
5262 [ Test ]
5363 public void TestCopyTo ( )
5464 {
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public SetSnapShot(IEnumerable<T> collection)
3333 }
3434 else
3535 {
36- _values . Add ( item , item ) ;
36+ _values [ item ] = item ;
3737 }
3838 }
3939 }
@@ -70,7 +70,7 @@ public void Add(T item)
7070 return ;
7171 }
7272
73- _values . Add ( item , item ) ;
73+ _values [ item ] = item ;
7474 }
7575
7676 public void Clear ( )
You can’t perform that action at this time.
0 commit comments