Пример #1
0
        public void NullApplyEdit()
        {
            AParent parent = new AParent();

            Assert.IsNull(parent.GetChildList(), "GetChildList should be null");

            parent.BeginEdit();
            AChildList list = parent.ChildList;

            Assert.IsNotNull(list, "ChildList should not be null");
            Assert.IsNotNull(parent.GetChildList(), "GetChildList should not be null");

            parent.ApplyEdit();
            Assert.IsNotNull(parent.GetChildList(), "GetChildList should not be null after ApplyEdit");
        }
Пример #2
0
        public void NewChildEditLevelApply()
        {
            AParent parent = new AParent();

            Assert.IsNull(parent.GetChildList(), "GetChildList should be null");

            parent.BeginEdit();
            AChildList list = parent.ChildList;

            Assert.IsNotNull(list, "ChildList should not be null");
            Assert.IsNotNull(parent.GetChildList(), "GetChildList should not be null");

            Assert.AreEqual(1, parent.EditLevel, "Parent edit level should be 1");
            Assert.AreEqual(1, list.EditLevel, "Child list edit level should be 1");
            Assert.AreEqual(1, list[0].EditLevel, "Child edit level should be 1");

            parent.ApplyEdit();
            Assert.AreEqual(0, parent.EditLevel, "Parent edit level should be 0");
            list = parent.GetChildList();
            Assert.AreEqual(0, list.EditLevel, "Child list edit level should be 0");
            Assert.AreEqual(0, list[0].EditLevel, "Child edit level should be 0");
        }