javaunit-testingjoda-money

What currency to use in unit tests?


I'm developing an application that relies heavily on Joda-Money, and have a number of unit tests that verify my business logic. One (admittedly minor) sticking point for me has been what sort of Money/BigMoney objects to test with; specifically, what CurrencyUnit to use.

As I see it, I have a couple of options:

Again, this is obviously a minor issue, but I'm curious if there's a standard practice for cases like this, or if there's a clear reason to prefer one of these options in particular.


Solution

  • Use USD (or, generally, whatever currency is most commonly used in your application). I say this for two reasons: