¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

[TDD] more comments


 

Don't forget, strings should be compared with .equals(), not ==
for example "GBP".equals(currency)
Whether == works instead of "equals" depends on the JDK's
implementation of "String". Most impls have a maximum number
of chars for this, so "CHF"=="CHF" may be true, but
"Indian Rupees"=="Indian Rupees" is false on most JDK's.

Beside never using == for String compare, we could
also test the jdk's implementation in a testcase :-)
or test Money for never having more than 3 chars
as the ISO currency code implies anyway.

cheers
Dierk