public void SimpleInheritanceTest()
        {
            SimpleTrackedObjectDerived to = new SimpleTrackedObjectDerived();
            var sot = (ITrackedObject)to;

            to.ChangeValues(1, 2, 3);

            sot.Tracker.Undo();

            Assert.AreEqual(0, to.P1);
            Assert.AreEqual(0, to.P2);
            Assert.AreEqual(0, to.P3);

            sot.Tracker.Redo();

            Assert.AreEqual(1, to.P1);
            Assert.AreEqual(2, to.P2);
            Assert.AreEqual(3, to.P3);

            to.P1 = 2;
            to.P1 = 3;
            to.P1 = 4;

            sot.Tracker.Undo(); Assert.AreEqual(3, to.P1);

            sot.Tracker.Undo(); Assert.AreEqual(2, to.P1);

            sot.Tracker.Undo(); Assert.AreEqual(1, to.P1);

            sot.Tracker.Undo(); Assert.AreEqual(0, to.P1);

            sot.Tracker.Undo(); Assert.AreEqual(0, to.P1); // empty undo collection

            sot.Tracker.Redo(); Assert.AreEqual(1, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(2, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(3, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(4, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(4, to.P1); // empty redo collection

            sot.Tracker.Undo(); Assert.AreEqual(3, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(4, to.P1);
        }
        public void SimpleInheritanceTest()
        {
            SimpleTrackedObjectDerived to = new SimpleTrackedObjectDerived();
            var sot = (ITrackedObject)to;

            to.ChangeValues(1, 2, 3);

            sot.Tracker.Undo();

            Assert.AreEqual(0, to.P1);
            Assert.AreEqual(0, to.P2);
            Assert.AreEqual(0, to.P3);

            sot.Tracker.Redo();

            Assert.AreEqual(1, to.P1);
            Assert.AreEqual(2, to.P2);
            Assert.AreEqual(3, to.P3);

            to.P1 = 2;
            to.P1 = 3;
            to.P1 = 4;

            sot.Tracker.Undo(); Assert.AreEqual(3, to.P1);

            sot.Tracker.Undo(); Assert.AreEqual(2, to.P1);

            sot.Tracker.Undo(); Assert.AreEqual(1, to.P1);

            sot.Tracker.Undo(); Assert.AreEqual(0, to.P1);

            sot.Tracker.Undo(); Assert.AreEqual(0, to.P1); // empty undo collection

            sot.Tracker.Redo(); Assert.AreEqual(1, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(2, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(3, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(4, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(4, to.P1); // empty redo collection

            sot.Tracker.Undo(); Assert.AreEqual(3, to.P1);

            sot.Tracker.Redo(); Assert.AreEqual(4, to.P1);
        }