public void TestConvertToDataWithMapper() { var data = new FakeDataEntity(); data = Mapper.ToEntity(_vm, data); ToDataAssert(data); }
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); }
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" }, }; }