コード例 #1
0
        public void CheckAndConfigureMappingTest_List_SameType_Success()
        {
            ExpressionMapper.Reset();
            ExpressionMapper.CreateMap <ClassSource2, ClassDest2>();

            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();

            MapperConfigurationCollectionContainer.Instance.Add(expected);
            ExpressionMapper.Initialize();
            Expression <Func <ClassSource, object> >     source = s => s.ListString;
            Expression <Func <ClassDest, object> >       target = d => d.ListString;
            Tuple <Expression, Expression, bool, string> tuple  = Tuple.Create(source.Body, target.Body, false, string.Empty);

            expected.CheckAndConfigureMappingTest(tuple);
            Assert.IsNotNull(expected.GetDelegate());
        }
コード例 #2
0
        public void CheckAndConfigureMappingTest_List_NotSameType_Success()
        {
            Mapper.Reset();
            Mapper.CreateMap<ClassSource2, ClassDest2>();
           
            
            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
            MapperConfigurationCollectionContainer.Instance.Add(expected);
            Mapper.Initialize();
            Expression<Func<ClassSource, object>> source = s => s.ListProp;
            Expression<Func<ClassDest, object>> target = d => d.ListProp;
            Tuple<Expression, Expression, bool, string> tuple = Tuple.Create(source.Body, target.Body, true,string.Empty);
            expected.CheckAndConfigureMappingTest(tuple);
            Assert.IsNotNull(expected.GetDelegate());


        }