Tuesday, July 26, 2011

Constructors Are Methods, too!

Yes, if your constructor does something meaningful. This is just like another method and should be treated equally for unit testsing purpose. Here's an example that should need unit test:

It looks simple, so testing it should be simple, too. I would only skip the default constuctors, as long as they don't do anything interesting.