public void CopyFromSameType_Field_ValueType() { var orig = new SettingsA(); var copy = new SettingsA(); orig.IntegerFieldA = 3; copy.CopyValuesFrom(orig); Assert.AreEqual(3, copy.IntegerFieldA); }
public void CloneFromParent() { var orig = new SettingsA(); orig.IntegerFieldA = 4; var copy = orig.CloneAs <SettingsB>(); Assert.IsNotNull(copy); Assert.AreEqual(4, copy.IntegerFieldA); }
public void CopyFromParent_Field_ValueType() { var orig = new SettingsA(); var copy = new SettingsB(); orig.IntegerFieldA = 8; copy.CopyValuesFrom(orig); Assert.AreEqual(8, copy.IntegerFieldA); }
public void CopyFromSameType_Property_ValueType() { var orig = new SettingsA(); var copy = new SettingsA(); orig.IntegerPropertyA = 5; copy.CopyValuesFrom(orig); Assert.AreEqual(5, copy.IntegerPropertyA); }
public void CopyFromChild_Field_ValueType() { var orig = new SettingsB(); var copy = new SettingsA(); orig.IntegerFieldA = 7; SettingsPrototype.CopyValuesFrom(copy, orig); Assert.AreEqual(7, copy.IntegerFieldA); }
public void Clone_StringsIndependant() { var orig = new SettingsA(); orig.StringFieldA = "hello"; var copy = orig.CloneAs <SettingsA>(); orig.StringFieldA = "world"; Assert.AreEqual("hello", copy.StringFieldA); }