コード例 #1
0
        public void CloneFromChild()
        {
            var orig = new SettingsB();

            orig.IntegerFieldA = 4;

            var copy = orig.CloneAs <SettingsA>();

            Assert.IsNotNull(copy);
            Assert.AreEqual(4, copy.IntegerFieldA);
        }
コード例 #2
0
        public void CopyFromParent_Field_ValueType()
        {
            var orig = new SettingsA();
            var copy = new SettingsB();

            orig.IntegerFieldA = 8;

            copy.CopyValuesFrom(orig);

            Assert.AreEqual(8, copy.IntegerFieldA);
        }
コード例 #3
0
        public void CopyFromSibling_Field_ValueType()
        {
            var orig = new SettingsB();
            var copy = new SettingsC();

            orig.IntegerFieldA = 9;

            copy.CopyValuesFrom(orig);

            Assert.AreEqual(9, copy.IntegerFieldA);
        }
コード例 #4
0
        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);
        }