Пример #1
0
        public void TestTargetNotNullableSourceNotNullable()
        {
            var from1 = new FromNotNullProp()
            {
                Id   = 2,
                Name = "2005",
                InM  = new InClassMapper()
                {
                    Owner = "紫妈",
                    Map   = new StructMapper()
                    {
                        Owner = "dld"
                    }
                }
            };
            var to1  = EasyMapper.Map <FromNotNullProp, ToNotNullProp>(from1);
            var to10 = new ToNotNullProp();
            var to11 = EasyMapper.Map <FromNotNullProp, ToNotNullProp>(from1, to10);

            var to2 = EasyMapper.Map <FromNotNullProp, ToNotNullField>(from1);

            var from2 = new FromNotNullField()
            {
                Id = 5, Name = "2005"
            };

            to1 = EasyMapper.Map <FromNotNullField, ToNotNullProp>(from2);
            to2 = EasyMapper.Map <FromNotNullField, ToNotNullField>(from2);
        }
Пример #2
0
        public void TestTargetNullableSourceNotNullable()
        {
            var from1 = new FromNotNullProp()
            {
                Id = 2, Name = "2005",
            };
            var to1  = EasyMapper.Map <FromNotNullProp, ToNullProp>(from1);
            var to10 = new ToNullProp()
            {
                InM = new InClassMapper()
            };
            var to11 = EasyMapper.Map <FromNotNullProp, ToNullProp>(from1, to10);

            var to2 = EasyMapper.Map <FromNotNullProp, ToNullField>(from1);

            var from2 = new FromNotNullField()
            {
                Id = 5, Name = "2005"
            };

            to1 = EasyMapper.Map <FromNotNullField, ToNullProp>(from2);
            to2 = EasyMapper.Map <FromNotNullField, ToNullField>(from2);
        }