示例#1
0
        public void Map_Class_With_Fields_Test()
        {
            var source = new TestMappingInterface1();

            source.Property1 = 99;
            source.field     = "Hello";

            var target = source.MapTo(new TestMappingInterface1());

            Assert.IsFalse(Object.ReferenceEquals(source, target));

            Assert.AreEqual(target.Property1, source.Property1);
            Assert.AreEqual(target.field, source.field);
        }
示例#2
0
        public void Map_Class_With_Struct_Test()
        {
            var source = new TestMappingInterface1();

            source.EinStruct = new TestMappingStruct
            {
                field = 88,
                Value = 2
            };

            var target = source.MapTo(new TestMappingInterface1());

            Assert.IsFalse(Object.ReferenceEquals(source, target));

            Assert.AreEqual(target.EinStruct.Value, source.EinStruct.Value);
            Assert.AreEqual(target.EinStruct.field, source.EinStruct.field);
        }