예제 #1
0
        public void Return_CircularReference()
        {
            var cloner = GetService();

            var i1 = new CircularItem("My value");

            var r1 = cloner.DeepClone <CircularItem>(i1);

            Assert.AreEqual("My value", r1.MyString);
            Assert.AreEqual("My value", r1.Item.MyString);
            Assert.AreEqual("My value", r1.Item.Item.MyString);
        }
예제 #2
0
        public CircularItem(string myString)
        {
            MyString = myString;

            this.Item = this;
        }