@@ -94,7 +94,7 @@ public void GetTypesShouldReturnSetOfDefinedTypes()
94
94
// Setup mocks
95
95
mockAssembly . Setup ( a => a . GetTypes ( ) ) . Returns ( expectedTypes ) ;
96
96
97
- IReadOnlyList < Type > types = AssemblyEnumerator . GetTypes ( mockAssembly . Object , string . Empty , _warnings ) ;
97
+ Type [ ] types = AssemblyEnumerator . GetTypes ( mockAssembly . Object , string . Empty , _warnings ) ;
98
98
Verify ( expectedTypes . SequenceEqual ( types ) ) ;
99
99
}
100
100
@@ -116,7 +116,7 @@ public void GetTypesShouldReturnReflectionTypeLoadExceptionTypesOnException()
116
116
// Setup mocks
117
117
mockAssembly . Setup ( a => a . GetTypes ( ) ) . Throws ( new ReflectionTypeLoadException ( reflectedTypes , null ) ) ;
118
118
119
- IReadOnlyList < Type > types = AssemblyEnumerator . GetTypes ( mockAssembly . Object , string . Empty , _warnings ) ;
119
+ Type [ ] types = AssemblyEnumerator . GetTypes ( mockAssembly . Object , string . Empty , _warnings ) ;
120
120
121
121
Verify ( types is not null ) ;
122
122
Verify ( reflectedTypes . Equals ( types ) ) ;
@@ -131,7 +131,10 @@ public void GetTypesShouldLogWarningsWhenReflectionFailsWithLoaderExceptions()
131
131
mockAssembly . Setup ( a => a . GetTypes ( ) ) . Throws ( new ReflectionTypeLoadException ( null , exceptions ) ) ;
132
132
mockAssembly . Setup ( a => a . GetTypes ( ) ) . Throws ( new ReflectionTypeLoadException ( null , exceptions ) ) ;
133
133
134
- IReadOnlyList < Type > types = AssemblyEnumerator . GetTypes ( mockAssembly . Object , "DummyAssembly" , _warnings ) ;
134
+ Type [ ] types = AssemblyEnumerator . GetTypes ( mockAssembly . Object , "DummyAssembly" , _warnings ) ;
135
+
136
+ // Depending on the TFM, .NET either gives us null or empty array.
137
+ Verify ( types is null || types . Length == 0 ) ;
135
138
136
139
Verify ( _warnings . Count == 1 ) ;
137
140
Verify ( _warnings . ToList ( ) . Contains (
0 commit comments