Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 public ClassMapperBuilder(IMapperBuilderConfig config) : base(config)
 {
     _memberMapper         = new MemberMapper(config);
     _mappingMemberBuilder = new MappingMemberBuilder(config);
 }
Ejemplo n.º 6
0
 public ClassMapperBuilder(MapperCache mapperCache, IMapperBuilderConfig config) : base(config)
 {
     _mapperCache          = mapperCache;
     _memberMapper         = new MemberMapper(mapperCache, config);
     _mappingMemberBuilder = new MappingMemberBuilder(config);
 }
Ejemplo n.º 7
0
 public MapperBuilder(IMapperConfig config)
 {
     MemberBuilder = new MappingMemberBuilder(config);
 }