@@ -10,15 +10,11 @@ namespace AutoMapper.UnitTests.Mappers
1010{
1111 public class When_adding_a_custom_mapper : NonValidatingSpecBase
1212 {
13- public When_adding_a_custom_mapper ( )
14- {
15- MapperRegistry . Mappers . Insert ( 0 , new TestObjectMapper ( ) ) ;
16- }
17-
1813 protected override MapperConfiguration Configuration { get ; } = new MapperConfiguration ( cfg =>
1914 {
2015 cfg . CreateMap < ClassA , ClassB > ( )
2116 . ForMember ( dest => dest . Destination , opt => opt . MapFrom ( src => src . Source ) ) ;
17+ cfg . Mappers . Add ( new TestObjectMapper ( ) ) ;
2218 } ) ;
2319
2420 [ Fact ]
@@ -78,7 +74,8 @@ public class When_adding_a_simple_custom_mapper : AutoMapperSpecBase
7874 {
7975 cfg . CreateMap < ClassA , ClassB > ( )
8076 . ForMember ( dest => dest . Destination , opt => opt . MapFrom ( src => src . Source ) ) ;
81- } , MapperRegistry . Mappers . Concat ( new [ ] { new TestObjectMapper ( ) } ) ) ;
77+ cfg . Mappers . Add ( new TestObjectMapper ( ) ) ;
78+ } ) ;
8279
8380 protected override void Because_of ( )
8481 {
@@ -162,7 +159,8 @@ public override string Map(object source, string destination, ResolutionContext
162159 protected override MapperConfiguration Configuration => new MapperConfiguration ( cfg =>
163160 {
164161 cfg . CreateMap < Source , Destination > ( ) ;
165- } , new [ ] { new EnumMapper ( ) } . Concat ( MapperRegistry . Mappers ) ) ;
162+ cfg . Mappers . Insert ( 0 , new EnumMapper ( ) ) ;
163+ } ) ;
166164
167165 protected override void Because_of ( )
168166 {
0 commit comments