Exemplo n.º 1
0
        public void TestConvertFromDataWithDynamicMapper()
        {
            var vm = new FakeVM();

            vm = Mapper.Map(_data, vm);
            FromDataAssert(vm);
        }
Exemplo n.º 2
0
 private void FromDataAssert(FakeVM vm)
 {
     Assert.AreEqual(vm.Name, _data.Name);
     Assert.AreEqual(vm.IsDeleted, _data.IsDeleted);
     Assert.AreEqual(vm.CreatedDate, _data.CreatedDate);
     Assert.AreEqual(vm.ID, _data.ID);
     Assert.AreEqual(vm.ReferenceID, _data.RefID);
     Assert.AreEqual(vm.CurrentDate, _data.CurrentDate);
     Assert.AreEqual(vm.RefItemName, _data.Item.Name);
     Assert.AreEqual(vm.Child.Name, _data.OneChild.Name);
 }
Exemplo n.º 3
0
        public void Init()
        {
            _data = new FakeDataEntity
            {
                CreatedDate      = DateTime.Today,
                CreatedBy        = "testuser",
                LastModifiedDate = DateTime.Today,
                LastModifiedBy   = "testuser",
                CurrentDate      = DateTime.Now,
                ID        = 10,
                IsDeleted = true,
                Name      = "Fake Entity",
                RefID     = 111,
                Item      = new RefItem {
                    Name = "Item Ref"
                },
                OneChild = new Child {
                    Name = "Item Child"
                }
            };

            _vm = new FakeVM
            {
                CreatedDate      = DateTime.Today,
                CreatedBy        = "testuser",
                LastModifiedDate = DateTime.Today,
                LastModifiedBy   = "testuser",
                CurrentDate      = DateTime.Now,
                ID          = 10,
                IsDeleted   = true,
                Name        = "Fake Entity",
                ReferenceID = 111,
                Children    = new List <string> {
                    "Test1", "Test2"
                }
            };
        }