private void Execute_WithDefaultRef(TypeModel model, string caption) { var b = CreateB_WithDefaultRef(); Assert.Same(b.A, b.Items[1]); //, caption + ":Original"); B_WithDefaultRef deserializedB = (B_WithDefaultRef)model.DeepClone(b); Assert.Same(deserializedB.A, deserializedB.Items[1]); //, caption + ":Clone"); }
static B_WithDefaultRef CreateB_WithDefaultRef() { A_WithDefaultRef a = new A_WithDefaultRef(); B_WithDefaultRef b = new B_WithDefaultRef(); b.A = a; b.Items.Add(1, a); return(b); }