示例#1
0
        private void TestCloneScalar <T>(T value)
        {
            // test scalar clone
            AttributeType scalarTest = new AttributeType("test", typeof(T));
            object        original   = value;
            object        clone      = scalarTest.Clone(original);

            Assert.AreEqual(original, clone);
            Assert.AreSame(original, clone);
        }
示例#2
0
        private void TestClone <T>(T value)
        {
            TestCloneScalar <T>(value);

            // test array clone
            AttributeType arrayTest = new AttributeType("test", typeof(T[]), 2);
            object        original  = new T[] { value, value };
            object        clone     = arrayTest.Clone(original);

            Assert.AreEqual(original, clone);
            Assert.AreNotSame(original, clone);
        }