public void EditableObjectWithUndoWhileEditingTest_CancelEditRollbackes()
        {
            EditableTrackedObjectClass editable = new EditableTrackedObjectClass();

            editable.BeginEdit();

            editable.IntP = 5;
            editable.StringP = "a";

            //((ITrackedObject)editable).Tracker.Undo();

            editable.Edit(1, "b");

            editable.CancelEdit();

            Assert.AreEqual(0, editable.IntP);
            Assert.IsNull(editable.StringP);
        }
        public void EditableObjectWithUndoWhileEditingTest_CancelEditRollbackes()
        {
            EditableTrackedObjectClass editable = new EditableTrackedObjectClass();

            editable.BeginEdit();

            editable.IntP    = 5;
            editable.StringP = "a";

            //((ITrackedObject)editable).Tracker.Undo();

            editable.Edit(1, "b");

            editable.CancelEdit();

            Assert.AreEqual(0, editable.IntP);
            Assert.IsNull(editable.StringP);
        }
        public void EditableObjectWithUndoWhileEditingTest_EndEditCommits()
        {
            EditableTrackedObjectClass editable = new EditableTrackedObjectClass();

            editable.BeginEdit();

            editable.IntP    = 5;
            editable.StringP = "a";

            ((ITrackedObject)editable).Tracker.Undo();

            editable.Edit(1, "b");

            editable.EndEdit();

            Assert.AreEqual(1, editable.IntP);
            Assert.AreEqual("b", editable.StringP);

            ((ITrackedObject)editable).Tracker.Undo();

            Assert.AreEqual(5, editable.IntP);
            Assert.IsNull(editable.StringP);
        }
        public void EditableObjectWithUndoWhileEditingTest_EndEditCommits()
        {
            EditableTrackedObjectClass editable = new EditableTrackedObjectClass();

            editable.BeginEdit();

            editable.IntP = 5;
            editable.StringP = "a";

            ((ITrackedObject)editable).Tracker.Undo();

            editable.Edit(1, "b");

            editable.EndEdit();

            Assert.AreEqual(1, editable.IntP);
            Assert.AreEqual("b", editable.StringP);

            ((ITrackedObject)editable).Tracker.Undo();

            Assert.AreEqual(5, editable.IntP);
            Assert.IsNull(editable.StringP);
        }