示例#1
0
        public void TestConvertToDataWithMapper()
        {
            var data = new FakeDataEntity();

            data = Mapper.ToEntity(_vm, data);
            ToDataAssert(data);
        }
示例#2
0
 private void ToDataAssert(FakeDataEntity data)
 {
     Assert.AreEqual(_vm.Name, data.Name);
     Assert.AreNotEqual(_vm.IsDeleted, data.IsDeleted);
     Assert.AreNotEqual(_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.Children.Count, data.ChildrenCount);
 }
示例#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"
                },
            };
        }