@@ -12,15 +12,15 @@ public class BucketsTests
1212 [ InlineData ( 1u ) ]
1313 [ InlineData ( 2u ) ]
1414 [ InlineData ( 11u ) ]
15- [ InlineData ( 1000u ) ]
15+ [ InlineData ( 100u ) ]
1616 internal void ShouldGetValues ( uint count )
1717 {
1818 // Given
1919 var data = CreatePairs ( count ) ;
20- var divisor = Buckets < string , int > . GetDivisor ( count ) ;
20+ var divisor = Buckets < int > . GetDivisor ( count ) ;
2121
2222 // When
23- var pairs = Buckets < string , int > . Create (
23+ var pairs = Buckets < int > . Create (
2424 divisor ,
2525 out var bucketSize ,
2626 data ) ;
@@ -37,13 +37,15 @@ internal void ShouldGetValues(uint count)
3737 }
3838 }
3939
40- private static Pair < string , int > [ ] CreatePairs ( uint count ) =>
41- Enumerable . Range ( 0 , ( int ) count )
42- . Select ( i => new Pair < string , int > ( ( 100 + i ) . ToString ( ) , i ) )
43- . ToArray ( ) ;
40+ private static Pair < int > [ ] CreatePairs ( uint count ) => AppDomain . CurrentDomain . GetAssemblies ( )
41+ . SelectMany ( i => i . ExportedTypes )
42+ . Distinct ( )
43+ . Take ( ( int ) count )
44+ . Select ( ( i , index ) => new Pair < int > ( i , index ) )
45+ . ToArray ( ) ;
4446
4547 private static TValue Get < TKey , TValue > (
46- Pair < TKey , TValue > [ ] pairs ,
48+ Pair < TValue > [ ] pairs ,
4749 uint divisor ,
4850 int bucketSize ,
4951 TKey key )
@@ -72,16 +74,16 @@ private static TValue Get<TKey, TValue>(
7274 public void ShouldSupportTypeKey ( )
7375 {
7476 // Given
75- var divisor = Buckets < Type , int > . GetDivisor ( 5 ) ;
76- var pairs = Buckets < Type , int > . Create (
77+ var divisor = Buckets < int > . GetDivisor ( 5 ) ;
78+ var pairs = Buckets < int > . Create (
7779 divisor ,
7880 out var bucketSize ,
7981 [
80- new Pair < Type , int > ( typeof ( string ) , 1 ) ,
81- new Pair < Type , int > ( typeof ( int ) , 2 ) ,
82- new Pair < Type , int > ( typeof ( double ) , 3 ) ,
83- new Pair < Type , int > ( typeof ( float ) , 4 ) ,
84- new Pair < Type , int > ( typeof ( char ) , 5 )
82+ new Pair < int > ( typeof ( string ) , 1 ) ,
83+ new Pair < int > ( typeof ( int ) , 2 ) ,
84+ new Pair < int > ( typeof ( double ) , 3 ) ,
85+ new Pair < int > ( typeof ( float ) , 4 ) ,
86+ new Pair < int > ( typeof ( char ) , 5 )
8587 ]
8688 ) ;
8789
0 commit comments