File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 33
44using System ;
55using System . Linq ;
6+ using System . Reflection ;
67using NUnit . Framework ;
7- using UnityEditor ;
88using UnityEngine ;
99
1010namespace TestHelper . UI . Paginators
@@ -14,7 +14,25 @@ public class IPaginatorTest
1414 {
1515 private static Type [ ] GetPaginators ( )
1616 {
17- return TypeCache . GetTypesDerivedFrom < IPaginator > ( ) . ToArray ( ) ;
17+ var interfaceType = typeof ( IPaginator ) ;
18+ return AppDomain . CurrentDomain . GetAssemblies ( )
19+ . SelectMany ( assembly =>
20+ {
21+ try
22+ {
23+ return assembly . GetTypes ( ) ;
24+ }
25+ catch ( ReflectionTypeLoadException ex )
26+ {
27+ return ex . Types . Where ( t => t != null ) ;
28+ }
29+ catch
30+ {
31+ return Enumerable . Empty < Type > ( ) ;
32+ }
33+ } )
34+ . Where ( t => t != null && interfaceType . IsAssignableFrom ( t ) && t . IsClass && ! t . IsAbstract )
35+ . ToArray ( ) ;
1836 }
1937
2038 /// <summary>
You can’t perform that action at this time.
0 commit comments