File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
AgileMapper.UnitTests/Configuration Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,25 @@ public void ShouldUseAConfiguredFactoryForAGivenType()
3131 }
3232 }
3333
34+ [ Fact ]
35+ public void ShouldUseAConfiguredFactoryWithAComplexTypeMemberBinding ( )
36+ {
37+ using ( var mapper = Mapper . CreateNew ( ) )
38+ {
39+ mapper . WhenMapping
40+ . InstancesOf < PublicCtor < Address > > ( )
41+ . CreateUsing ( ctx => new PublicCtor < Address > ( new Address ( ) ) { Value = { Line2 = "Some Street" } } ) ;
42+
43+ var source = new PublicField < PersonViewModel > { Value = new PersonViewModel ( ) } ;
44+ var target = new PublicSetMethod < PublicCtor < Address > > ( ) ;
45+ var result = mapper . Map ( source ) . OnTo ( target ) ;
46+
47+ result . Value . ShouldNotBeNull ( ) ;
48+ result . Value . Value . ShouldNotBeNull ( ) ;
49+ result . Value . Value . Line2 . ShouldBe ( "Some Street" ) ;
50+ }
51+ }
52+
3453 [ Fact ]
3554 public void ShouldUseAConfiguredFactoryForASpecifiedSourceAndTargetType ( )
3655 {
You can’t perform that action at this time.
0 commit comments