Ejemplo n.º 1
0
        public void CanTrackCollectionPropertiesOfNonTrackableTypes()
        {
            WhateverParent parent = TrackableObjectFactory.CreateFrom(new WhateverParent());

            parent.List2.Add("hey");
            parent.List.Add(new Whatever());

            Assert.AreEqual(2, parent.GetChangeTracker().ChangedProperties.Count);
        }
Ejemplo n.º 2
0
        public void CollectionItemsArePreservedWhenTurningParentObjectIntoTrackable()
        {
            A a = TrackableObjectFactory.CreateFrom(new A());

            Assert.AreEqual(3, a.Items.Count);

            WhateverParent parent = new WhateverParent();

            parent.List.Add(new Whatever());
            parent.List2.Add("hey");

            parent = TrackableObjectFactory.CreateFrom(parent);

            Assert.AreEqual(1, parent.List.Count);
            Assert.AreEqual(1, parent.List2.Count);
        }