Ejemplo n.º 1
0
        public void Remove_WhenCalledAndReverted_RemovesAndReverts()
        {
            TrackedCollection <int> tc = new TrackedCollection <int>(CollectionTrackingStrategy.TrackOnlyCollectionOperations);

            tc.Tracker.Track();

            tc.Add(0);
            tc.Add(1);
            tc.Add(2);

            tc.Remove(0);
            tc.Remove(1);

            Assert.IsFalse(tc.Contains(0));
            Assert.IsFalse(tc.Contains(1));

            tc.Tracker.Undo();

            Assert.IsTrue(tc.Contains(1));
        }
        public void Remove_WhenCalledAndReverted_RemovesAndReverts()
        {
            TrackedCollection<int> tc = new TrackedCollection<int>(CollectionTrackingStrategy.TrackOnlyCollectionOperations);

            tc.Tracker.Track();

            tc.Add(0);
            tc.Add(1);
            tc.Add(2);

            tc.Remove(0);
            tc.Remove(1);

            Assert.IsFalse(tc.Contains(0));
            Assert.IsFalse(tc.Contains(1));

            tc.Tracker.Undo();

            Assert.IsTrue(tc.Contains(1));
        }