Have you thought about using serialisation for deep cloning (using
MemoryStream) ?

Sébastien

On 10/29/07, David Nicholson <[EMAIL PROTECTED]> wrote:
> I have some classes where I provide a Clone() method to provide a deep
> copy of an instance, and would like to test that I haven't added a member
> to the class without also adding it to Clone().
>
> To test Clone() I set a non-default value for the member, then check that
> the cloned copy has that value. However if I forget to add it to Clone(),
> I'll probably also forget to add it to the test.
>
> Does anyone have a way to do this, other than the obvious one of being
> more disciplined?
>
> Thanks
> David.
>
> ===================================
> This list is hosted by DevelopMentor(R)  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>


-- 
Sébastien
www.sebastienlorion.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to