示例#1
0
        public void ExpressionMapTest()
        {
            var date         = DateTime.Now;
            var clonnedClass = new MappedClass
            {
                DateTimeProp = date,
                IntProp      = 5,
                StringProp   = "qwe"
            };

            var destClass = new DestClass
            {
                DateTimeProp = date,
                IntProp      = 5,
                StringProp   = "qwe"
            };

            var mapper = new ExpressionMapper();

            mapper.Register <MappedClass, DestClass>();

            var mapped = mapper.Map <MappedClass, DestClass>(clonnedClass);

            mapped.Should().BeEquivalentTo(destClass);

            Assert.Pass();
        }