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