Example #1
0
 /// <summary>
 /// 转换多次AutoMapper赋值
 /// </summary>
 private void BatchAutoToBEMapper()
 {
     for (int i = 0; i < ITERATION; i++)
     {
         User target = new User(); // TODO: 初始化为适当的值
         UserDTO dto = target.ReturnUserDTO(); // TODO: 初始化为适当的值
         User be = target.TransitiontoBE(dto);
     }
 }
Example #2
0
 /// <summary>
 /// 转换多次TOBE通过一一赋值
 /// </summary>
 private void BatchDTOToBEFromUserDTO()
 {
     for (int i = 0; i < ITERATION; i++)
     {
         User user = new User();
         UserDTO dto = user.ReturnUserDTO();
         user = dto.ToBE(dto);
     }
 }
Example #3
0
        public void DTOToBECeshi()
        {
            User target = new User(); // TODO: 初始化为适当的值
            UserDTO dto = target.ReturnUserDTO(); // TODO: 初始化为适当的值
            //Order expected = null; // TODO: 初始化为适当的值
            User actual;
            actual = target.ToBE(dto);

            Assert.AreEqual(actual.Birthday, dto.Birthday);
            Assert.AreEqual(actual.ID, dto.ID);
            Assert.AreEqual(actual.CreatedBy, dto.CreatedBy);
            Assert.AreEqual(actual.CreatedOn, dto.CreatedOn);
        }