File tree Expand file tree Collapse file tree 9 files changed +61
-14
lines changed
AppCoreNet.Extensions.DependencyInjection.AssemblyExtensions.Tests
AppCoreNet.Extensions.DependencyInjection.Tests/Facilities Expand file tree Collapse file tree 9 files changed +61
-14
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,16 @@ public void ResolvesAllFacilityExtensions()
4646 . Add ( typeof ( AssemblyResolverTests ) . Assembly )
4747 . ClearDefaultFilters ( ) ;
4848
49- IEnumerable < IFacilityExtension < IFacility > > facilityExtensions =
50- ( ( IFacilityExtensionResolver ) resolver ) . Resolve ( typeof ( Facility1 ) ) ;
49+ IFacilityExtension [ ] facilityExtensions =
50+ ( ( IFacilityExtensionResolver ) resolver ) . Resolve ( typeof ( Facility1 ) )
51+ . ToArray ( ) ;
5152
52- facilityExtensions . Should ( )
53- . AllBeOfType < FacilityExtensionWrapper < Facility1 > > ( ) ;
53+ facilityExtensions [ 0 ]
54+ . Should ( )
55+ . BeOfType < Facility1Extension1 > ( ) ;
5456
55- facilityExtensions . OfType < FacilityExtensionWrapper < Facility1 > > ( )
56- . Select ( e => e . Extension . GetType ( ) )
57- . Should ( )
58- . BeEquivalentTo ( new [ ] { typeof ( Facility1Extension1 ) , typeof ( Facility1Extension2 ) } ) ;
57+ facilityExtensions [ 1 ]
58+ . Should ( )
59+ . BeOfType < Facility1Extension2 > ( ) ;
5960 }
6061}
Original file line number Diff line number Diff line change 11// Licensed under the MIT license.
22// Copyright (c) The AppCore .NET project.
33
4- using AppCoreNet . Extensions . DependencyInjection . Facilities ;
54using Microsoft . Extensions . DependencyInjection ;
65
76namespace AppCoreNet . Extensions . DependencyInjection ;
87
9- public class Facility1 : IFacility
8+ public class Facility1 : IFacility1
109{
1110 public void ConfigureServices ( IServiceCollection services )
1211 {
Original file line number Diff line number Diff line change 66
77namespace AppCoreNet . Extensions . DependencyInjection ;
88
9- public class Facility1Extension2 : IFacilityExtension < Facility1 >
9+ public class Facility1Extension2 : IFacilityExtension < IFacility1 >
1010{
1111 public void ConfigureServices ( IServiceCollection services )
1212 {
Original file line number Diff line number Diff line change 11// Licensed under the MIT license.
22// Copyright (c) The AppCore .NET project.
33
4- using AppCoreNet . Extensions . DependencyInjection . Facilities ;
54using Microsoft . Extensions . DependencyInjection ;
65
76namespace AppCoreNet . Extensions . DependencyInjection ;
87
9- public class Facility2 : IFacility
8+ public class Facility2 : IFacility2
109{
1110 public void ConfigureServices ( IServiceCollection services )
1211 {
Original file line number Diff line number Diff line change 1+ // Licensed under the MIT license.
2+ // Copyright (c) The AppCore .NET project.
3+
4+ using AppCoreNet . Extensions . DependencyInjection . Facilities ;
5+ using Microsoft . Extensions . DependencyInjection ;
6+
7+ namespace AppCoreNet . Extensions . DependencyInjection ;
8+
9+ public class Facility2Extension1 : IFacilityExtension < Facility2 >
10+ {
11+ public void ConfigureServices ( IServiceCollection services )
12+ {
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ // Licensed under the MIT license.
2+ // Copyright (c) The AppCore .NET project.
3+
4+ using AppCoreNet . Extensions . DependencyInjection . Facilities ;
5+ using Microsoft . Extensions . DependencyInjection ;
6+
7+ namespace AppCoreNet . Extensions . DependencyInjection ;
8+
9+ public class Facility2Extension2 : IFacilityExtension < IFacility2 >
10+ {
11+ public void ConfigureServices ( IServiceCollection services )
12+ {
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ // Licensed under the MIT license.
2+ // Copyright (c) The AppCore .NET project.
3+
4+ using AppCoreNet . Extensions . DependencyInjection . Facilities ;
5+
6+ namespace AppCoreNet . Extensions . DependencyInjection ;
7+
8+ public interface IFacility1 : IFacility
9+ {
10+ }
Original file line number Diff line number Diff line change 1+ // Licensed under the MIT license.
2+ // Copyright (c) The AppCore .NET project.
3+
4+ using AppCoreNet . Extensions . DependencyInjection . Facilities ;
5+
6+ namespace AppCoreNet . Extensions . DependencyInjection ;
7+
8+ public interface IFacility2 : IFacility
9+ {
10+ }
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public void AddExtensionsFromInvokesResolver()
7474 {
7575 var resolver = Substitute . For < IFacilityExtensionResolver > ( ) ;
7676 resolver . Resolve ( Arg . Any < Type > ( ) )
77- . Returns ( Array . Empty < IFacilityExtension < IFacility > > ( ) ) ;
77+ . Returns ( Array . Empty < IFacilityExtension > ( ) ) ;
7878
7979 var builder = new FacilityBuilder < TestFacility > ( _services , _activator ) ;
8080 builder . AddExtensionsFrom ( r => r . AddResolver ( resolver ) ) ;
You can’t perform that action at this time.
0 commit comments