@@ -46,9 +46,9 @@ public void GetSelectedMembers_WhenSelectIsEmpty_MustReturnAllLiteralAndLiteralL
4646 Assert . Multiple ( ( ) =>
4747 {
4848 var names = memberInfos . Select ( mi => mi . Name ) . ToList ( ) ;
49-
49+
5050 Assert . DoesNotContain ( memberInfos , name => name . Name == nameof ( Thing . Objects ) ) ;
51-
51+
5252 Assert . Contains ( names , name => name == nameof ( Thing . ParametersArray ) ) ;
5353 Assert . Contains ( names , name => name == nameof ( Thing . ParametersList ) ) ;
5454 Assert . Contains ( names , name => name == nameof ( Thing . Ints ) ) ;
@@ -64,6 +64,30 @@ public void GetSelectedMembers_WhenSelectIsEmpty_MustReturnAllLiteralAndLiteralL
6464 } ) ;
6565 }
6666
67+ [ Fact ]
68+ public void GetSelectedMembers_WhenSelectIsEmpty_MustReturnAllLiteralAndLiteralDictionaries ( )
69+ {
70+ // Act
71+ var memberInfos = typeof ( Dictionaries ) . GetSelectedMembers ( Enumerable . Empty < string > ( ) . ToList ( ) ) ;
72+
73+ // Assert
74+ Assert . Multiple ( ( ) =>
75+ {
76+ var names = memberInfos . Select ( mi => mi . Name ) . ToList ( ) ;
77+
78+ Assert . DoesNotContain ( memberInfos , name => name . Name == nameof ( Dictionaries . ObjectDictionary ) ) ;
79+
80+ Assert . Contains ( names , name => name == nameof ( Dictionaries . InnerDictionary ) ) ;
81+ Assert . Contains ( names , name => name == nameof ( Dictionaries . InnerDictionary2 ) ) ;
82+ Assert . Contains ( names , name => name == nameof ( Dictionaries . ListIntStringDictionary ) ) ;
83+ Assert . Contains ( names , name => name == nameof ( Dictionaries . IntStringDictionary ) ) ;
84+ Assert . Contains ( names , name => name == nameof ( Dictionaries . ListStringDictionary ) ) ;
85+ Assert . Contains ( names , name => name == nameof ( Dictionaries . ListOfDictionaries ) ) ;
86+ Assert . Contains ( names , name => name == nameof ( Dictionaries . ArrayOfDictionaries ) ) ;
87+ Assert . Contains ( names , name => name == nameof ( Dictionaries . ArrayOfLookups ) ) ;
88+ } ) ;
89+ }
90+
6791 private abstract class BaseThing
6892 {
6993 public string Name { get ; set ; }
@@ -97,5 +121,18 @@ private class Thing
97121 public IEnumerable < int > Ints { get ; set ; }
98122 public List < object > Objects { get ; set ; }
99123 }
124+
125+ private sealed class Dictionaries
126+ {
127+ public Dictionary < int , string > IntStringDictionary { get ; set ; }
128+ public Dictionary < List < int > , string > ListIntStringDictionary { get ; set ; }
129+ public Dictionary < string , List < string > > ListStringDictionary { get ; set ; }
130+ public Dictionary < Dictionary < string , int > , List < string > > InnerDictionary { get ; set ; }
131+ public Dictionary < List < string > , Dictionary < string , int > > InnerDictionary2 { get ; set ; }
132+ public Dictionary < List < object > , Dictionary < string , int > > ObjectDictionary { get ; set ; }
133+ public List < Dictionary < List < int > , string [ ] > > ListOfDictionaries { get ; set ; }
134+ public Dictionary < int , string > [ ] ArrayOfDictionaries { get ; set ; }
135+ public Lookup < int , string > [ ] ArrayOfLookups { get ; set ; }
136+ }
100137 }
101138}
0 commit comments