@@ -10,26 +10,51 @@ namespace Shuttle.Core.Reflection.Tests
1010 public class ReflectionServiceFixture
1111 {
1212 [ Test ]
13- public async Task Should_be_able_to_get_runtime_assemblies ( )
13+ public void Should_be_able_to_get_runtime_assemblies ( )
1414 {
15- Assert . That ( ( await new ReflectionService ( ) . GetRuntimeAssemblies ( ) ) . Count ( ) , Is . GreaterThan ( 0 ) ) ;
15+ Assert . That ( new ReflectionService ( ) . GetRuntimeAssemblies ( ) . Count ( ) , Is . GreaterThan ( 0 ) ) ;
1616 }
1717
1818 [ Test ]
19- public async Task Should_be_able_to_get_types ( )
19+ public async Task Should_be_able_to_get_runtime_assemblies_async ( )
2020 {
21- Assert . That ( ( await new ReflectionService ( ) . GetTypesAssignableTo < SomeClass > ( ) ) . Count ( ) , Is . EqualTo ( 1 ) ) ;
22- Assert . That ( ( await new ReflectionService ( ) . GetTypesAssignableTo < ISomeClass > ( ) ) . Count ( ) , Is . EqualTo ( 1 ) ) ;
21+ Assert . That ( ( await new ReflectionService ( ) . GetRuntimeAssembliesAsync ( ) ) . Count ( ) , Is . GreaterThan ( 0 ) ) ;
2322 }
2423
2524 [ Test ]
26- public async Task Should_be_able_to_get_matching_assemblies ( )
25+ public void Should_be_able_to_get_types ( )
26+ {
27+ Assert . That ( new ReflectionService ( ) . GetTypesAssignableTo < SomeClass > ( ) . Count ( ) , Is . EqualTo ( 1 ) ) ;
28+ Assert . That ( new ReflectionService ( ) . GetTypesAssignableTo < ISomeClass > ( ) . Count ( ) , Is . EqualTo ( 1 ) ) ;
29+ }
30+
31+ [ Test ]
32+ public async Task Should_be_able_to_get_types_async ( )
33+ {
34+ Assert . That ( ( await new ReflectionService ( ) . GetTypesAssignableToAsync < SomeClass > ( ) ) . Count ( ) , Is . EqualTo ( 1 ) ) ;
35+ Assert . That ( ( await new ReflectionService ( ) . GetTypesAssignableToAsync < ISomeClass > ( ) ) . Count ( ) , Is . EqualTo ( 1 ) ) ;
36+ }
37+
38+ [ Test ]
39+ public void Should_be_able_to_get_matching_assemblies ( )
40+ {
41+ var service = new ReflectionService ( ) ;
42+
43+ Assert . That ( service . GetMatchingAssemblies ( ".+" ) . Count ( ) , Is . GreaterThan ( 0 ) ) ;
44+
45+ foreach ( var assembly in service . GetMatchingAssemblies ( "nunit" ) )
46+ {
47+ Assert . That ( assembly . FullName . Contains ( "nunit" ) ) ;
48+ }
49+ }
50+
51+ public async Task Should_be_able_to_get_matching_assemblies_async ( )
2752 {
2853 var service = new ReflectionService ( ) ;
2954
30- Assert . That ( ( await service . GetMatchingAssemblies ( ".+" ) ) . Count ( ) , Is . GreaterThan ( 0 ) ) ;
55+ Assert . That ( ( await service . GetMatchingAssembliesAsync ( ".+" ) ) . Count ( ) , Is . GreaterThan ( 0 ) ) ;
3156
32- foreach ( var assembly in ( await service . GetMatchingAssemblies ( "nunit" ) ) )
57+ foreach ( var assembly in ( await service . GetMatchingAssembliesAsync ( "nunit" ) ) )
3358 {
3459 Assert . That ( assembly . FullName . Contains ( "nunit" ) ) ;
3560 }
0 commit comments