2
votes
2answers
120 views

How to (or should I) have one assert per test with object comparisons? [duplicate]

I've recently read The Art of Unit Testing by Roy Osherove which I found very useful for helping me establish how to define a good unit test. One key aspect of the guidelines Roy puts forward are to ...
0
votes
2answers
637 views

When to use identity comparison instead of equals?

I wonder why would anybody want to use identity comparison for fields in equals, like here (Java syntax): class C { private A a; public boolean equals(Object other) { // standard ...