By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,892 Members | 1,156 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,892 IT Pros & Developers. It's quick & easy.

Re: Creating a unit test in vs2008 for an object that holds strings?

P: n/a
Alain Boss wrote:
If you only use some getters/setters on this class i wouldn't spend much
time on unit tests.
Believe it or not, but I have actually seen getters and setters
being wrong after too much copy paste (it was not C# but that does
not really matter).

As a consequence I am paranoid enough to even make unit tests
for that type of class.

Arne
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Arne Vajhøj wrote:
Alain Boss wrote:
>If you only use some getters/setters on this class i wouldn't spend
much time on unit tests.

Believe it or not, but I have actually seen getters and setters
being wrong after too much copy paste (it was not C# but that does
not really matter).

As a consequence I am paranoid enough to even make unit tests
for that type of class.

Arne
Well, i have seen setters in legacy code that are longer than my arm
too. In this case Unit tests are definitely called for.

alain
Jun 27 '08 #2

P: n/a
Arne Vajhøj wrote:
Alain Boss wrote:
>If you only use some getters/setters on this class i wouldn't spend
much time on unit tests.

Believe it or not, but I have actually seen getters and setters
being wrong after too much copy paste (it was not C# but that does
not really matter).
These bugs should be found by the unit tests for the consumer classes.
>
As a consequence I am paranoid enough to even make unit tests
for that type of class.

Arne

Jun 27 '08 #3

P: n/a
Ben Voigt [C++ MVP] wrote:
Arne Vajhøj wrote:
>Alain Boss wrote:
>>If you only use some getters/setters on this class i wouldn't spend
much time on unit tests.
Believe it or not, but I have actually seen getters and setters
being wrong after too much copy paste (it was not C# but that does
not really matter).

These bugs should be found by the unit tests for the consumer classes.
Usually will.

And if the consumer class is done by the same team at the same
time, then no big deal.

But another team taking a drop finding the bug 3 months later
will not be pleased.

Arne
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.