Пример #1
0
        public void NewChildEditLevelCancel()
        {
            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.CancelEdit();
              Assert.AreEqual(0, parent.EditLevel, "Parent edit level should be 0");
              Assert.IsNull(parent.GetChildList(), "GetChildList should be null after CancelEdit");
        }
Пример #2
0
        public void NullCancelEdit()
        {
            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.BeginEdit();
              list = parent.ChildList;
              Assert.IsNotNull(list, "ChildList should not be null");
              Assert.IsNotNull(parent.GetChildList(), "GetChildList should not be null after 2nd BeginEdit");

              parent.CancelEdit();
              Assert.IsNotNull(parent.GetChildList(), "GetChildList should not be null after 1st CancelEdit");

              parent.CancelEdit();
              Assert.IsNull(parent.GetChildList(), "GetChildList should be null after CancelEdit");
        }
Пример #3
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");
        }