Example #1
0
 public void RollbackTo(TrackableDataContainerTracker tracker)
 {
     if (PersonTracker != null)
     {
         PersonTracker.RollbackTo(tracker.PersonTracker);
     }
     if (DictionaryTracker != null)
     {
         DictionaryTracker.RollbackTo(tracker.DictionaryTracker);
     }
     if (ListTracker != null)
     {
         ListTracker.RollbackTo(tracker.ListTracker);
     }
 }
Example #2
0
        public void ContainerTest_ApplyToTracker_Work()
        {
            var c = CreateTestContainerWithTracker();

            c.Person.Name = "Bob";
            c.Person.Age  = 30;

            var tracker2 = new TrackableDataContainerTracker();

            c.Tracker.ApplyTo(tracker2);

            var c2 = CreateTestContainer();

            tracker2.ApplyTo(c2);

            Assert.Equal(c.Person.Name, c2.Person.Name);
            Assert.Equal(c.Person.Age, c2.Person.Age);
        }