Hello, David.

You could reflect the public properties and verify that they aren't set to
the default value (I wonder if you could use generics for this?) and that
they match.

Regards,

Shane

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
>

===================================
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