public void CloneLevel3() { var obj = ModelBaseTestHelper.CreateComputerSettingsObject(); var clonedObj = obj.Clone(); Assert.AreEqual(obj, clonedObj); }
public void BinarySerializationLevel3() { var originalObject = ModelBaseTestHelper.CreateComputerSettingsObject(); var clonedObject = SerializationTestHelper.SerializeAndDeserializeObject(originalObject, SerializationMode.Binary); Assert.AreEqual(originalObject, clonedObject); }
public void Equals_AreNotEqual() { // Create 2 objects var obj1 = ModelBaseTestHelper.CreateComputerSettingsObject(); var obj2 = ModelBaseTestHelper.CreateIniFileObject(); // Equals Assert.AreNotEqual(obj1, obj2); }
public void EqualsLevel3() { // Create 2 objects var obj1 = ModelBaseTestHelper.CreateComputerSettingsObject(); var obj2 = ModelBaseTestHelper.CreateComputerSettingsObject(); // Equals Assert.AreEqual(obj1, obj2); }
public void IsDirtyWithChildrenWhenSavingParent() { // 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 2"; Assert.IsTrue(computerSettings.IniFileCollection[0].IsDirty); Assert.IsTrue(computerSettings.IsDirty); // Save the top level SaveObjectToMemoryStream(computerSettings); Assert.IsFalse(computerSettings.IniFileCollection[0].IniEntryCollection[0].IsDirty); Assert.IsFalse(computerSettings.IsDirty); }