public void ObjectMapConfig_Map_Object_ValueType()
        {
            var config = new ObjectMapConfig();

            var u1 = new UserFlatten();

            u1.X = 5;
            u1.Y = 7;
            var v1 = config.Map(u1, new Vector2(3, 6));

            Assert.AreEqual(u1.X, v1.X);
            Assert.AreEqual(u1.Y, v1.Y);
        }
示例#2
0
        public void ObjectMapper_Map_Object_ValueType()
        {
            var mapper = new ObjectMapper();

            var u1 = new UserFlatten();

            u1.X = 5;
            u1.Y = 7;
            var v1 = mapper.Map(u1, new Vector2(3, 6));

            Assert.AreEqual(u1.X, v1.X);
            Assert.AreEqual(u1.Y, v1.Y);
        }
示例#3
0
        public void ObjectMapper_Map_Dynamic_Object()
        {
            var mapper = new ObjectMapper();

            dynamic u1 = new UserFlatten();

            u1.Name  = "User1";
            u1.Int32 = 4;

            var u2 = new User();

            mapper.Map(u1, u2);

            Assert.AreEqual(u2.Int32, u1.Int32);
            Assert.AreEqual(u2.Name, u1.Name);
        }