After reading Joshua Blosh's Effective Java 2nd edition, I decided to implement equals, hashcode and comparable(where applicable) to every class I have been implementing.
I have written a generic unit test class for equals, hashcode and comparable that will test every contract of each function.
I've attached the generic tester class for anyone who would be interested in seeing them.
My question is, am I overkilling the testing? Have I missed any clause in the equals, hashcode and compareTo contract? These is a tester class I've written once, and used numerous times. However, working on my own, I have not had the chance to get a second opinion with fellow developers.
Thanks in advance,
Lucas
Aucun commentaire:
Enregistrer un commentaire