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); }
public CircularItem(string myString) { MyString = myString; this.Item = this; }