Catel.Test.Data.ModelBaseTest.IsDirtyWithChildrenWhenSavingChild C# (CSharp) Метод

IsDirtyWithChildrenWhenSavingChild() приватный Метод

private IsDirtyWithChildrenWhenSavingChild ( ) : void
Результат void
        public void IsDirtyWithChildrenWhenSavingChild()
        {
            // Create a collection
            var computerSettings = ModelBaseTestHelper.CreateComputerSettingsObject();
            SaveObjectToMemoryStream(computerSettings);
            Assert.IsFalse(computerSettings.IsDirty);

            // Make a chance in the lowest level (but only if ObservableCollection, that is the only supported type)
            computerSettings.IniFileCollection[0].FileName = "is dirty should be enabled now";
            Assert.IsTrue(computerSettings.IniFileCollection[0].IsDirty);
            Assert.IsTrue(computerSettings.IsDirty);

            // Save the lowest level (so the parent stays dirty)
            SaveObjectToMemoryStream(computerSettings.IniFileCollection[0].IniEntryCollection[0]);
            Assert.IsFalse(computerSettings.IniFileCollection[0].IniEntryCollection[0].IsDirty);
            Assert.IsTrue(computerSettings.IsDirty);
        }
ModelBaseTest