public void test1() { ICloneable inst1 = new CustomCloneable(); var inst2 = (CustomCloneable)inst1.Clone(); AssertEquals("inst1", 0, ((CustomCloneable)inst1).Counter); AssertEquals("inst2", 1, inst2.Counter); }
public ClassB DeepCopy(ClassB obj) { return(CustomCloneable <ClassB> .DeepCopy(this)); }
// implement ICustomCloneable using static helpers public ClassB ShallowCopy(ClassB obj) { return(CustomCloneable <ClassB> .ShallowCopy(this)); }