File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
NHibernate/Collection/Generic/SetHelpers
NHibernate.Test/UtilityTest 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()
49
49
Assert . That ( sn . TryGetValue ( null , out _ ) , Is . True ) ;
50
50
}
51
51
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
+
52
62
[ Test ]
53
63
public void TestCopyTo ( )
54
64
{
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public SetSnapShot(IEnumerable<T> collection)
33
33
}
34
34
else
35
35
{
36
- _values . Add ( item , item ) ;
36
+ _values [ item ] = item ;
37
37
}
38
38
}
39
39
}
@@ -70,7 +70,7 @@ public void Add(T item)
70
70
return ;
71
71
}
72
72
73
- _values . Add ( item , item ) ;
73
+ _values [ item ] = item ;
74
74
}
75
75
76
76
public void Clear ( )
You can’t perform that action at this time.
0 commit comments