Implement the equality check!
As a matter of good practice, you should implement the equality check for data type objects where object comparison is necessary.
Language | Method |
---|---|
Java | equals() |
C# | Equals() |
With testing in general, many tests will want to test whether ObjectA == ObjectB
. Your test framework would then use the equals assertion. If the equality check does not exist, you will get an error like this (depending on IDE and language).
![](../__attachments/1514536986/ug-implement-equals.webp?inst-v=5e1cb58c-56f0-4e45-b834-ef0000ddaa47)