public void StringAsReference()
        {
            var obj = new StringRefType {
                Foo = GetString(), Bar = GetString()
            };

            Assert.False(ReferenceEquals(obj.Foo, obj.Bar));
            var clone = Serializer.DeepClone(obj);

            Assert.Equal(obj.Foo, clone.Foo);
            Assert.Equal(obj.Bar, clone.Bar);
            Assert.True(ReferenceEquals(clone.Foo, clone.Bar));
        }
Пример #2
0
 public void StringAsReference()
 {
     var obj = new StringRefType { Foo = GetString(), Bar = GetString() };
     Assert.IsFalse(ReferenceEquals(obj.Foo, obj.Bar));
     var clone = Serializer.DeepClone(obj);
     Assert.AreEqual(obj.Foo, clone.Foo);
     Assert.AreEqual(obj.Bar, clone.Bar);
     Assert.IsTrue(ReferenceEquals(clone.Foo, clone.Bar));
 }