Is it important to unit test a constructor?

Unit testing is about testing the public states, behaviors, and interactions of your objects.

If you simply set a private field in your constructor, what is there to test?

Don’t bother unit-testing your simple accessors and mutators. That’s just silly, and it doesn’t help anyone.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)