Exemple #1
0
        public void Build_CommonFileds_Success()
        {
            var mappingMemberBuilder         = new MappingMemberBuilder(new MappingBuilderConfigStub());
            List <MappingMemberPath> members = mappingMemberBuilder.Build(new TypePair(typeof(SourceSimple), typeof(TargetSimple)));

            XAssert.Equal(2, members.Count);
        }
Exemple #2
0
        public void Buid_Recursion_Success()
        {
            var mappingMemberBuilder         = new MappingMemberBuilder(new MappingBuilderConfigStub());
            List <MappingMemberPath> members = mappingMemberBuilder.Build(new TypePair(typeof(SourceWithRecursion), typeof(TargetWithRecursion)));

            XAssert.Equal(2, members.Count);
        }
Exemple #3
0
        public void Build_IgnoreProperty_Success()
        {
            var bindingConfig = new BindingConfig();

            bindingConfig.IgnoreSourceField(nameof(SourceWithRecursion.Id));

            var mappingMemberBuilder = new MappingMemberBuilder(new MappingBuilderConfigStub(bindingConfig));

            List <MappingMemberPath> members = mappingMemberBuilder.Build(new TypePair(typeof(SourceWithRecursion), typeof(TargetWithRecursion)));

            XAssert.Single(members);
        }
Exemple #4
0
        public void Build_IgnoreProperty_Success()
        {
            var bindingConfig = new BindingConfig();

            bindingConfig.IgnoreField("Id");

            var mappingMemberBuilder = new MappingMemberBuilder(new MappingBuilderConfigStub(bindingConfig));

            List <MappingMember> members = mappingMemberBuilder.Build(new TypePair(typeof(Source1), typeof(Target1)));

            Assert.Equal(1, members.Count);
        }
 public ClassMapperBuilder(IMapperBuilderConfig config) : base(config)
 {
     _memberMapper         = new MemberMapper(config);
     _mappingMemberBuilder = new MappingMemberBuilder(config);
 }
Exemple #6
0
 public ClassMapperBuilder(MapperCache mapperCache, IMapperBuilderConfig config) : base(config)
 {
     _mapperCache          = mapperCache;
     _memberMapper         = new MemberMapper(mapperCache, config);
     _mappingMemberBuilder = new MappingMemberBuilder(config);
 }
Exemple #7
0
 public MapperBuilder(IMapperConfig config)
 {
     MemberBuilder = new MappingMemberBuilder(config);
 }