public void should_mapping_owner_dto_for_with_mapping_logic() { var config_for_dto = TypeAdapterConfig <Owner, OwnerDto> .NewConfig() .Map(dest => dest.FullName, src => src.FirstName + src.LastName).Config; var ownerDto = _owner.Adapt <OwnerDto>(config_for_dto); ownerDto.ShouldNotBeNull(); ownerDto.FullName.ShouldBe("zhangsan"); ownerDto.Id.ShouldBe(_ownerId.ToString()); var config_for_entity = TypeAdapterConfig <OwnerDto, Owner> .NewConfig() .Map(dest => dest.FirstName, src => src.FullName) .Map(dest => dest.LastName, src => src.FullName).Config; var owner = ownerDto.Adapt <Owner>(config_for_entity); owner.Id.ShouldBe(_ownerId); owner.FirstName.ShouldBe("zhangsan"); owner.LastName.ShouldBe("zhangsan"); }