コード例 #1
0
        public void RollbackTo_WhenCollectionLoadedAfterRollbackPoint_DoesNotClearCollection()
        {
            Employee employee = new Employee();

            employee.Projects.Add(new Project());

            EmployeeVM.InitializeFrom(employee);

            IRollbackPoint rollbackPoint = EmployeeVM.UndoManager.GetRollbackPoint();

            ViewModelAssert.IsNotLoaded(EmployeeVM, x => x.Projects);
            EmployeeVM.Load(x => x.Projects);
            Assert.AreEqual(1, EmployeeVM.Projects.Count);

            EmployeeVM.UndoManager.RollbackTo(rollbackPoint);

            ViewModelAssert.IsLoaded(EmployeeVM, x => x.Projects);
            Assert.AreEqual(1, EmployeeVM.Projects.Count);
        }
コード例 #2
0
 public void IsLoaded_WhenCacheIsPopulated_ReturnsTrue()
 {
     VM.Load(x => x.MappedProperty);
     ViewModelAssert.IsLoaded(VM, x => x.MappedProperty);
 }